mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-05 13:20:47 -06:00
try_compile: Add option to control type of target
Create a `CMAKE_TRY_COMPILE_TARGET_TYPE` option to specify use of `add_library(... STATIC ...)` for the generated test project. This will be useful for cross-compiling toolchains that cannot link a binary without custom flags or scripts.
This commit is contained in:
15
Help/variable/CMAKE_TRY_COMPILE_TARGET_TYPE.rst
Normal file
15
Help/variable/CMAKE_TRY_COMPILE_TARGET_TYPE.rst
Normal file
@@ -0,0 +1,15 @@
|
||||
CMAKE_TRY_COMPILE_TARGET_TYPE
|
||||
-----------------------------
|
||||
|
||||
Type of target generated for :command:`try_compile` calls using the
|
||||
source file signature. Valid values are:
|
||||
|
||||
``EXECUTABLE``
|
||||
Use :command:`add_executable` to name the source file in the
|
||||
generated project. This is the default if no value is given.
|
||||
|
||||
``STATIC_LIBRARY``
|
||||
Use :command:`add_library` with the ``STATIC`` option to name the
|
||||
source file in the generated project. This avoids running the
|
||||
linker and is intended for use with cross-compiling toolchains
|
||||
that cannot link without custom flags or linker scripts.
|
||||
Reference in New Issue
Block a user