bc685a7eb800c1548b960c2c27ab880dfcd259f0
[platform/upstream/cmake.git] / Modules / CMakeCUDACompilerId.cu.in
1 #ifndef __CUDACC__
2 # error "A C or C++ compiler has been selected for CUDA"
3 #endif
4
5 @CMAKE_CUDA_COMPILER_ID_CONTENT@
6
7 /* Construct the string literal in pieces to prevent the source from
8    getting matched.  Store it in a pointer rather than an array
9    because some compilers will just produce instructions to fill the
10    array rather than assigning a pointer to a static array.  */
11 char const* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]";
12 #ifdef SIMULATE_ID
13 char const* info_simulate = "INFO" ":" "simulate[" SIMULATE_ID "]";
14 #endif
15
16 @CMAKE_CUDA_COMPILER_ID_PLATFORM_CONTENT@
17 @CMAKE_CUDA_COMPILER_ID_ERROR_FOR_TEST@
18
19 const char* info_language_standard_default = "INFO" ":" "standard_default["
20 #if __cplusplus > 202002L
21   "23"
22 #elif __cplusplus > 201703L
23   "20"
24 #elif __cplusplus >= 201703L
25   "17"
26 #elif __cplusplus >= 201402L
27   "14"
28 #elif __cplusplus >= 201103L
29   "11"
30 #else
31   "03"
32 #endif
33 "]";
34
35 const char* info_language_extensions_default = "INFO" ":" "extensions_default["
36 // !defined(_MSC_VER) to exclude Clang's MSVC compatibility mode.
37 #if (defined(__clang__) || defined(__GNUC__)) && !defined(__STRICT_ANSI__) && \
38   !defined(_MSC_VER)
39   "ON"
40 #else
41   "OFF"
42 #endif
43 "]";
44
45 /*--------------------------------------------------------------------------*/
46
47 int main(int argc, char* argv[])
48 {
49   int require = 0;
50   require += info_compiler[argc];
51   require += info_platform[argc];
52 #ifdef COMPILER_VERSION_MAJOR
53   require += info_version[argc];
54 #endif
55 #ifdef SIMULATE_ID
56   require += info_simulate[argc];
57 #endif
58 #ifdef SIMULATE_VERSION_MAJOR
59   require += info_simulate_version[argc];
60 #endif
61   require += info_language_standard_default[argc];
62   require += info_language_extensions_default[argc];
63   (void)argv;
64   return require;
65 }