summaryrefslogtreecommitdiffstats
path: root/Help/variable
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2016-02-19 18:23:48 (GMT)
committerBrad King <brad.king@kitware.com>2016-02-19 19:07:38 (GMT)
commit7f1bd9fe6910f7633d98dec018cc01331a46b87e (patch)
treed7f1e58c327d7aecd6ce861b6cd6b3c65c8bff71 /Help/variable
parent509b1f08ea3ee1d8063efc81fee851ee075b3c97 (diff)
downloadCMake-7f1bd9fe6910f7633d98dec018cc01331a46b87e.zip
CMake-7f1bd9fe6910f7633d98dec018cc01331a46b87e.tar.gz
CMake-7f1bd9fe6910f7633d98dec018cc01331a46b87e.tar.bz2
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.
Diffstat (limited to 'Help/variable')
-rw-r--r--Help/variable/CMAKE_TRY_COMPILE_TARGET_TYPE.rst15
1 files changed, 15 insertions, 0 deletions
diff --git a/Help/variable/CMAKE_TRY_COMPILE_TARGET_TYPE.rst b/Help/variable/CMAKE_TRY_COMPILE_TARGET_TYPE.rst
new file mode 100644
index 0000000..5fa8dfc
--- /dev/null
+++ b/Help/variable/CMAKE_TRY_COMPILE_TARGET_TYPE.rst
@@ -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.