COMPILE_WRAPPERS¶
Added in version 4.5.
List of wrapper names to be prepended to the compile commands for a target's sources.
This property holds a semicolon-separated list
of names, where each item is a <NAME> keyed to the
CMAKE_COMPILE_WRAPPER_<NAME> global property.
Note
If a target has multiple wrappers, either via its COMPILE_WRAPPERS and/or
the INTERFACE_COMPILE_WRAPPERS inherited from its dependents, the
wrappers will be deduplicated and ordered lexicographically based on their
name in the resulting compile command(s).
This property is supported only by Makefile Generators and
Ninja Generators, and is ignored by other generators. Further, it is
supported only when the target's language is one of: C, CXX, CUDA,
Fortran, HIP, ISPC, OBJC, OBJCXX.
Contents of COMPILE_WRAPPERS may use "generator expressions" with the
syntax $<...>. See the cmake-generator-expressions(7) manual for
available expressions. See the cmake-buildsystem(7) manual for more
on defining buildsystem properties.
Interaction With Launchers¶
Wrappers are placed outside of any <LANG>_COMPILER_LAUNCHER.
The resulting compile command is:
<wrappers...> <launcher...> <compiler> <arguments...>
A tool that expects to be given the compiler as its first argument, such as
ccache or distcc, should be used as a launcher rather than a wrapper.
When a static analysis tool is enabled for a source via
<LANG>_CLANG_TIDY, <LANG>_CPPCHECK,
<LANG>_CPPLINT, <LANG>_INCLUDE_WHAT_YOU_USE, or a
similar property, the wrappers and the launcher apply only to the compiler
invocation and not to the analysis tool.
The launcher used by ctest(1) (see CTEST_USE_LAUNCHERS)
remains outermost and runs the wrappers as part of the command it launches.
See Also¶
Related properties: