UNITY_BUILD_CODE_BEFORE_INCLUDE

From Get docs
Cmake/docs/3.21/prop tgt/unity build code before include /
Revision as of 02:58, 6 December 2021 by Notes (talk | contribs) (Page commit)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)


UNITY_BUILD_CODE_BEFORE_INCLUDE

New in version 3.16.


Code snippet which is included verbatim by the UNITY_BUILD feature just before every #include statement in the generated unity source files. For example:

set(before [[../
#if !defined(NOMINMAX)
#define NOMINMAX
#endif
]])
set_target_properties(myTarget PROPERTIES
  UNITY_BUILD_CODE_BEFORE_INCLUDE "${before}"
)

See also UNITY_BUILD_CODE_AFTER_INCLUDE.

© 2000–2021 Kitware, Inc. and Contributors
Licensed under the BSD 3-clause License.
https://cmake.org/cmake/help/v3.21/prop_tgt/UNITY_BUILD_CODE_BEFORE_INCLUDE.html