summaryrefslogtreecommitdiffstats
path: root/Help/prop_tgt/UNITY_BUILD_CODE_BEFORE_INCLUDE.rst
diff options
context:
space:
mode:
Diffstat (limited to 'Help/prop_tgt/UNITY_BUILD_CODE_BEFORE_INCLUDE.rst')
-rw-r--r--Help/prop_tgt/UNITY_BUILD_CODE_BEFORE_INCLUDE.rst17
1 files changed, 14 insertions, 3 deletions
diff --git a/Help/prop_tgt/UNITY_BUILD_CODE_BEFORE_INCLUDE.rst b/Help/prop_tgt/UNITY_BUILD_CODE_BEFORE_INCLUDE.rst
index f335463..7ed6fa1 100644
--- a/Help/prop_tgt/UNITY_BUILD_CODE_BEFORE_INCLUDE.rst
+++ b/Help/prop_tgt/UNITY_BUILD_CODE_BEFORE_INCLUDE.rst
@@ -2,7 +2,18 @@ UNITY_BUILD_CODE_BEFORE_INCLUDE
-------------------------------
Code snippet which is included verbatim by the :prop_tgt:`UNITY_BUILD`
-feature just before the `#include` statement of the targeted source
-files.
+feature just before every ``#include`` statement in the generated unity
+source files. For example:
-This could be something like `#define NOMINMAX`.
+.. code-block:: cmake
+
+ set(before [[
+ #if !defined(NOMINMAX)
+ #define NOMINMAX
+ #endif
+ ]])
+ set_target_properties(myTarget PROPERTIES
+ UNITY_BUILD_CODE_BEFORE_INCLUDE "${before}"
+ )
+
+See also :prop_tgt:`UNITY_BUILD_CODE_AFTER_INCLUDE`.