2019-08-29 04:49:29 +08:00
# vcpkg_fail_port_install
2021-03-11 01:56:07 +08:00
The latest version of this document lives in the [vcpkg repo ](https://github.com/Microsoft/vcpkg/blob/master/docs/maintainers/vcpkg_fail_port_install.md ).
2021-03-01 05:17:19 +08:00
2020-02-13 07:58:43 +08:00
Checks common requirements and fails the current portfile with a (default) error message
2019-08-29 04:49:29 +08:00
## Usage
```cmake
2020-02-13 07:58:43 +08:00
vcpkg_fail_port_install(
[ALWAYS]
[MESSAGE < "Reason for failure">]
[ON_TARGET < Windows > [< OSX > ...]]
[ON_ARCH < x64 > [< arm > ...]]
[ON_CRT_LINKAGE < static > [< dynamic > ...]])
[ON_LIBRARY_LINKAGE < static > [< dynamic > ...]]
)
2019-08-29 04:49:29 +08:00
```
## Parameters
### MESSAGE
2020-02-13 07:58:43 +08:00
Additional failure message. If none is given, a default message will be displayed depending on the failure condition.
2019-08-29 04:49:29 +08:00
### ALWAYS
2020-02-13 07:58:43 +08:00
Will always fail early
2019-08-29 04:49:29 +08:00
### ON_TARGET
2020-02-13 07:58:43 +08:00
Targets for which the build should fail early. Valid targets are `<target>` from `VCPKG_IS_TARGET_<target>` (see `vcpkg_common_definitions.cmake` ).
2019-08-29 04:49:29 +08:00
### ON_ARCH
2020-02-13 07:58:43 +08:00
Architecture for which the build should fail early.
2019-08-29 04:49:29 +08:00
### ON_CRT_LINKAGE
CRT linkage for which the build should fail early.
### ON_LIBRARY_LINKAGE
2020-02-13 07:58:43 +08:00
Library linkage for which the build should fail early.
2019-08-29 04:49:29 +08:00
## Examples
* [aws-lambda-cpp ](https://github.com/Microsoft/vcpkg/blob/master/ports/aws-lambda-cpp/portfile.cmake )
## Source
2021-03-01 05:17:19 +08:00
[scripts/cmake/vcpkg\_fail\_port\_install.cmake ](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_fail_port_install.cmake )