CMAKE_<LANG>_LINKER_WRAPPER_FLAG

Defines the syntax of compiler driver option to pass options to the linker tool. It will be used to translate the LINKER: prefix in the link options (see add_link_options() and target_link_options()).

This variable holds a semicolon-separated list of tokens. If a space (i.e. ” “) is specified as last token, flag and LINKER: arguments will be specified as separate arguments to the compiler driver. The CMAKE_<LANG>_LINKER_WRAPPER_FLAG_SEP variable can be specified to manage concatenation of arguments.

For example, for Clang we have:

set (CMAKE_C_LINKER_WRAPPER_FLAG "-Xlinker" " ")

Specifying "LINKER:-z,defs" will be transformed in -Xlinker -z -Xlinker defs.

For GNU GCC:

set (CMAKE_C_LINKER_WRAPPER_FLAG "-Wl,")
set (CMAKE_C_LINKER_WRAPPER_FLAG_SEP ",")

Specifying "LINKER:-z,defs" will be transformed in -Wl,-z,defs.

And for SunPro:

set (CMAKE_C_LINKER_WRAPPER_FLAG "-Qoption" "ld" " ")
set (CMAKE_C_LINKER_WRAPPER_FLAG_SEP ",")

Specifying "LINKER:-z,defs" will be transformed in -Qoption ld -z,defs.

© 2000–2020 Kitware, Inc. and Contributors
Licensed under the BSD 3-clause License.
https://cmake.org/cmake/help/v3.17/variable/CMAKE_LANG_LINKER_WRAPPER_FLAG.html