summaryrefslogtreecommitdiffstats
path: root/Tests/CMakeCommands/target_compile_options/consumer.c
blob: f9b66543a62953f6925fe33003ac9211772bb907 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40

// 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
#  ifndef CONSUMER_LANG_CXX
#    error Expected CONSUMER_LANG_CXX
#  endif

#  ifdef CONSUMER_LANG_C
#    error Unexpected CONSUMER_LANG_C
#  endif

#  if !LANG_IS_CXX
#    error Expected LANG_IS_CXX
#  endif

#  if LANG_IS_C
#    error Unexpected LANG_IS_C
#  endif
#else
#  ifdef CONSUMER_LANG_CXX
#    error Unexpected CONSUMER_LANG_CXX
#  endif

#  ifndef CONSUMER_LANG_C
#    error Expected CONSUMER_LANG_C
#  endif

#  if !LANG_IS_C
#    error Expected LANG_IS_C
#  endif

#  if LANG_IS_CXX
#    error Unexpected LANG_IS_CXX
#  endif
#endif

void consumer_c()
{
}