diff options
author | Brad King <brad.king@kitware.com> | 2018-12-06 14:03:52 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2018-12-06 14:03:58 (GMT) |
commit | d0e371f516085a8d744eaf3b24902c35a910528a (patch) | |
tree | 65af2c2699a240c3873a17f36bfc726c0811bad0 /Help | |
parent | 0464298956a204578aa8421ca0b84c089a97e0aa (diff) | |
parent | f266182aecb687f0c20c7fa7019ad0dde3222f46 (diff) | |
download | CMake-d0e371f516085a8d744eaf3b24902c35a910528a.zip CMake-d0e371f516085a8d744eaf3b24902c35a910528a.tar.gz CMake-d0e371f516085a8d744eaf3b24902c35a910528a.tar.bz2 |
Merge topic 'try-compile'
f266182aec Check* functions family: add support for LINK_OPTIONS
29f9db5c63 try_compile/try_run: Add support for LINK_OPTIONS option.
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2661
Diffstat (limited to 'Help')
-rw-r--r-- | Help/command/try_compile.rst | 9 | ||||
-rw-r--r-- | Help/command/try_run.rst | 7 | ||||
-rw-r--r-- | Help/release/dev/check-functions-LINK_OPTIONS.rst | 5 | ||||
-rw-r--r-- | Help/release/dev/try_compile-LINK_OPTIONS.rst | 5 |
4 files changed, 24 insertions, 2 deletions
diff --git a/Help/command/try_compile.rst b/Help/command/try_compile.rst index 310ad11..f50fcb6 100644 --- a/Help/command/try_compile.rst +++ b/Help/command/try_compile.rst @@ -33,6 +33,7 @@ Try Compiling Source Files try_compile(RESULT_VAR <bindir> <srcfile|SOURCES srcfile...> [CMAKE_FLAGS <flags>...] [COMPILE_DEFINITIONS <defs>...] + [LINK_OPTIONS <options>...] [LINK_LIBRARIES <libs>...] [OUTPUT_VARIABLE <var>] [COPY_FILE <fileName> [COPY_FILE_ERROR <var>]] @@ -55,6 +56,7 @@ the source(s) as an executable that looks something like this: include_directories(${INCLUDE_DIRECTORIES}) link_directories(${LINK_DIRECTORIES}) add_executable(cmTryCompileExec <srcfile>...) + target_link_options(cmTryCompileExec PRIVATE <LINK_OPTIONS from caller>) target_link_libraries(cmTryCompileExec ${LINK_LIBRARIES}) The options are: @@ -67,7 +69,7 @@ The options are: are used. ``COMPILE_DEFINITIONS <defs>...`` - Specify ``-Ddefinition`` arguments to pass to ``add_definitions`` + Specify ``-Ddefinition`` arguments to pass to :command:`add_definitions` in the generated test project. ``COPY_FILE <fileName>`` @@ -85,6 +87,11 @@ The options are: If this option is specified, any ``-DLINK_LIBRARIES=...`` value given to the ``CMAKE_FLAGS`` option will be ignored. +``LINK_OPTIONS <options>...`` + Specify link step options to pass to :command:`target_link_options` or + to :prop_tgt:`STATIC_LIBRARY_OPTIONS` target property in the generated + project, depending of the :variable:`CMAKE_TRY_COMPILE_TARGET_TYPE` variable. + ``OUTPUT_VARIABLE <var>`` Store the output from the build process the given variable. diff --git a/Help/command/try_run.rst b/Help/command/try_run.rst index dfa0bf9..137402f 100644 --- a/Help/command/try_run.rst +++ b/Help/command/try_run.rst @@ -15,6 +15,7 @@ Try Compiling and Running Source Files try_run(RUN_RESULT_VAR COMPILE_RESULT_VAR bindir srcfile [CMAKE_FLAGS <flags>...] [COMPILE_DEFINITIONS <defs>...] + [LINK_OPTIONS <options>...] [LINK_LIBRARIES <libs>...] [COMPILE_OUTPUT_VARIABLE <var>] [RUN_OUTPUT_VARIABLE <var>] @@ -38,7 +39,7 @@ The options are: are used. ``COMPILE_DEFINITIONS <defs>...`` - Specify ``-Ddefinition`` arguments to pass to ``add_definitions`` + Specify ``-Ddefinition`` arguments to pass to :command:`add_definitions` in the generated test project. ``COMPILE_OUTPUT_VARIABLE <var>`` @@ -52,6 +53,10 @@ The options are: If this option is specified, any ``-DLINK_LIBRARIES=...`` value given to the ``CMAKE_FLAGS`` option will be ignored. +``LINK_OPTIONS <options>...`` + Specify link step options to pass to :command:`target_link_options` in the + generated project. + ``OUTPUT_VARIABLE <var>`` Report the compile build output and the output from running the executable in the given variable. This option exists for legacy reasons. Prefer diff --git a/Help/release/dev/check-functions-LINK_OPTIONS.rst b/Help/release/dev/check-functions-LINK_OPTIONS.rst new file mode 100644 index 0000000..a6bfed2 --- /dev/null +++ b/Help/release/dev/check-functions-LINK_OPTIONS.rst @@ -0,0 +1,5 @@ +check-functions-LINK_OPTIONS +---------------------------- + +* The family of modules to check capabilities (like + :module:`CheckCSourceCompiles`) gain capability to manage ``LINK_OPTIONS``. diff --git a/Help/release/dev/try_compile-LINK_OPTIONS.rst b/Help/release/dev/try_compile-LINK_OPTIONS.rst new file mode 100644 index 0000000..1db485b --- /dev/null +++ b/Help/release/dev/try_compile-LINK_OPTIONS.rst @@ -0,0 +1,5 @@ +try_compile-LINK_OPTIONS +------------------------ + +* The commands :command:`try_compile` and :command:`try_run` gain new + option ``LINK_OPTIONS``. |