summaryrefslogtreecommitdiffstats
path: root/Tests/CMakeCommands/target_include_directories/consumer.c
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/CMakeCommands/target_include_directories/consumer.c')
-rw-r--r--Tests/CMakeCommands/target_include_directories/consumer.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/Tests/CMakeCommands/target_include_directories/consumer.c b/Tests/CMakeCommands/target_include_directories/consumer.c
index ae88f92..419c2d2 100644
--- a/Tests/CMakeCommands/target_include_directories/consumer.c
+++ b/Tests/CMakeCommands/target_include_directories/consumer.c
@@ -1,5 +1,13 @@
-#ifdef TEST_LANG_DEFINES
+// Visual Studio allows only one set of flags for C and C++.
+// In a target using C++ we pick the C++ flags even for C sources.
+#ifdef TEST_LANG_DEFINES_FOR_VISUAL_STUDIO_OR_XCODE
+#include "cxx_only.h"
+
+#ifndef CXX_ONLY_DEFINE
+#error Expected CXX_ONLY_DEFINE
+#endif
+#else
#include "c_only.h"
#ifndef C_ONLY_DEFINE