Merge topic 'try_compile-target-type'

7f1bd9fe try_compile: Add option to control type of target
This commit is contained in:
Brad King
2016-02-26 10:31:28 -05:00
committed by CMake Topic Stage
15 changed files with 136 additions and 15 deletions
+3
View File
@@ -112,3 +112,6 @@ The current setting of :policy:`CMP0065` is set in the generated project.
Set the :variable:`CMAKE_TRY_COMPILE_CONFIGURATION` variable to choose
a build configuration.
Set the :variable:`CMAKE_TRY_COMPILE_TARGET_TYPE` variable to specify
the type of target used for the source file signature.
+1
View File
@@ -292,6 +292,7 @@ Variables that Control the Build
/variable/CMAKE_STATIC_LINKER_FLAGS_CONFIG
/variable/CMAKE_STATIC_LINKER_FLAGS
/variable/CMAKE_TRY_COMPILE_CONFIGURATION
/variable/CMAKE_TRY_COMPILE_TARGET_TYPE
/variable/CMAKE_USE_RELATIVE_PATHS
/variable/CMAKE_VISIBILITY_INLINES_HIDDEN
/variable/CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD
@@ -0,0 +1,8 @@
try_compile-target-type
-----------------------
* The :command:`try_compile` command learned to check a new
:variable:`CMAKE_TRY_COMPILE_TARGET_TYPE` variable to optionally
build a static library instead of an executable. This is useful
for cross-compiling toolchains that cannot link binaries without
custom flags or scripts.
@@ -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.