Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorMartin Hořeňovský2022-02-20 13:17:40 +0100
committerMartin Hořeňovský2022-02-20 19:32:22 +0100
commitbda4b7df844b7d6f68aa0faacfa17a348b02937f (patch)
tree0b5638e79f6f5d57ca2a3984c993c784e239e317 /src
parent0c722564c34277b2afc2f76bd9f3176c509caf7a (diff)
downloadcatch3-bda4b7df844b7d6f68aa0faacfa17a348b02937f.tar.gz
Fix fallback stringifier config
Diffstat (limited to 'src')
-rw-r--r--src/catch2/catch_user_config.hpp.in19
1 files changed, 6 insertions, 13 deletions
diff --git a/src/catch2/catch_user_config.hpp.in b/src/catch2/catch_user_config.hpp.in
index 3cfbed4a..b3a518f9 100644
--- a/src/catch2/catch_user_config.hpp.in
+++ b/src/catch2/catch_user_config.hpp.in
@@ -177,6 +177,7 @@
#cmakedefine CATCH_CONFIG_PREFIX_ALL
#cmakedefine CATCH_CONFIG_WINDOWS_CRTDBG
+
// ------
// "Variable" defines, these have actual values
// ------
@@ -184,18 +185,10 @@
#define CATCH_CONFIG_DEFAULT_REPORTER "@CATCH_CONFIG_DEFAULT_REPORTER@"
#define CATCH_CONFIG_CONSOLE_WIDTH @CATCH_CONFIG_CONSOLE_WIDTH@
-// The logic here depends on CMake preprocessing of the file significantly.
-// If CMake has CATCH_CONFIG_FALLBACK_STRINGIFIER it will be define below,
-// and its value is written into the if. Thus, we undef the old placeholder
-// and then define the macro to the actual CMake-provided value.
-//
-// We can't do it without this indirection, because it is a string-variable
-// macro, so we need it's value, and there is no usable default value that
-// would let us have it always defined the way the other two are.
-#cmakedefine CATCH_CONFIG_FALLBACK_STRINGIFIER
-#if defined( CATCH_CONFIG_FALLBACK_STRINGIFIER )
-# undef CATCH_CONFIG_FALLBACK_STRINGIFIER
-# define CATCH_CONFIG_FALLBACK_STRINGIFIER @CATCH_CONFIG_FALLBACK_STRINGIFIER@
-#endif
+// Unlike the macros above, CATCH_CONFIG_FALLBACK_STRINGIFIER does not
+// have a good default value, so we cannot always define it, and cannot
+// even expose it as a variable in CMake. The users will have to find
+// out about it from docs and set it only if they use it.
+#cmakedefine CATCH_CONFIG_FALLBACK_STRINGIFIER @CATCH_CONFIG_FALLBACK_STRINGIFIER@
#endif // CATCH_USER_CONFIG_HPP_INCLUDED