try_{compile,run}: add LINKER_LANGUAGE option

Fixes: #25326
This commit is contained in:
scivision
2023-10-12 13:49:15 -04:00
committed by Brad King
parent dc0dbffb0f
commit 0f37000304
10 changed files with 89 additions and 1 deletions
+9
View File
@@ -77,6 +77,7 @@ Try Compiling Source Files
[COMPILE_DEFINITIONS <defs>...]
[LINK_OPTIONS <options>...]
[LINK_LIBRARIES <libs>...]
[LINKER_LANGUAGE <lang>]
[OUTPUT_VARIABLE <var>]
[COPY_FILE <fileName> [COPY_FILE_ERROR <var>]]
[<LANG>_STANDARD <std>]
@@ -184,6 +185,14 @@ The options for the above signatures are:
set the :prop_tgt:`STATIC_LIBRARY_OPTIONS` target property in the generated
project, depending on the :variable:`CMAKE_TRY_COMPILE_TARGET_TYPE` variable.
``LINKER_LANGUAGE <lang>```
.. versionadded:: 3.29
Specify the :prop_tgt:`LINKER_LANGUAGE` target property of the generated
project. When using multiple source files with different languages, set
this to the language of the source file containing the program entry point,
e.g., ``main``.
``LOG_DESCRIPTION <text>``
.. versionadded:: 3.26
+1
View File
@@ -67,6 +67,7 @@ The signature above is recommended for clarity.
[COMPILE_DEFINITIONS <defs>...]
[LINK_OPTIONS <options>...]
[LINK_LIBRARIES <libs>...]
[LINKER_LANGUAGE <lang>]
[COMPILE_OUTPUT_VARIABLE <var>]
[COPY_FILE <fileName> [COPY_FILE_ERROR <var>]]
[<LANG>_STANDARD <std>]