diff options
author | Marc Chevrier <marc.chevrier@gmail.com> | 2018-11-19 16:23:45 (GMT) |
---|---|---|
committer | Marc Chevrier <marc.chevrier@gmail.com> | 2018-12-01 16:56:23 (GMT) |
commit | 29f9db5c63dbfa53acdb449fad78d716a4113a88 (patch) | |
tree | 6b6ba4b75a7e906a455024292fe9f5f25299c8a1 /Help/command/try_compile.rst | |
parent | 78c2edb129594b198157799b3eb327f4a3915908 (diff) | |
download | CMake-29f9db5c63dbfa53acdb449fad78d716a4113a88.zip CMake-29f9db5c63dbfa53acdb449fad78d716a4113a88.tar.gz CMake-29f9db5c63dbfa53acdb449fad78d716a4113a88.tar.bz2 |
try_compile/try_run: Add support for LINK_OPTIONS option.
Diffstat (limited to 'Help/command/try_compile.rst')
-rw-r--r-- | Help/command/try_compile.rst | 9 |
1 files changed, 8 insertions, 1 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. |