Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Kitware
GitHub Repository: Kitware/CMake
Path: blob/master/Tests/CMakeCommands/target_compile_options/consumer.c
3152 views
1
2
// Visual Studio allows only one set of flags for C and C++.
3
// In a target using C++ we pick the C++ flags even for C sources.
4
#ifdef TEST_LANG_DEFINES_FOR_VISUAL_STUDIO
5
# ifndef CONSUMER_LANG_CXX
6
# error Expected CONSUMER_LANG_CXX
7
# endif
8
9
# ifdef CONSUMER_LANG_C
10
# error Unexpected CONSUMER_LANG_C
11
# endif
12
13
# if !LANG_IS_CXX
14
# error Expected LANG_IS_CXX
15
# endif
16
17
# if LANG_IS_C
18
# error Unexpected LANG_IS_C
19
# endif
20
#else
21
# ifdef CONSUMER_LANG_CXX
22
# error Unexpected CONSUMER_LANG_CXX
23
# endif
24
25
# ifndef CONSUMER_LANG_C
26
# error Expected CONSUMER_LANG_C
27
# endif
28
29
# if !LANG_IS_C
30
# error Expected LANG_IS_C
31
# endif
32
33
# if LANG_IS_CXX
34
# error Unexpected LANG_IS_CXX
35
# endif
36
#endif
37
38
void consumer_c(void)
39
{
40
}
41
42