1
+ if (NOT DEFINED LLVM_LIBC_COMPILER_IS_GCC_COMPATIBLE)
2
+ if (CMAKE_COMPILER_IS_GNUCXX)
3
+ set (LLVM_LIBC_COMPILER_IS_GCC_COMPATIBLE ON )
4
+ elseif ( MSVC )
5
+ set (LLVM_LIBC_COMPILER_IS_GCC_COMPATIBLE OFF )
6
+ elseif ( "${CMAKE_CXX_COMPILER_ID} " MATCHES "Clang" )
7
+ set (LLVM_LIBC_COMPILER_IS_GCC_COMPATIBLE ON )
8
+ elseif ( "${CMAKE_CXX_COMPILER_ID} " MATCHES "Intel" )
9
+ set (LLVM_LIBC_COMPILER_IS_GCC_COMPATIBLE ON )
10
+ endif ()
11
+ endif ()
12
+
1
13
function (_get_compile_options_from_flags output_var)
2
14
set (compile_options "" )
3
15
@@ -8,7 +20,7 @@ function(_get_compile_options_from_flags output_var)
8
20
check_flag(ADD_EXPLICIT_SIMD_OPT_FLAG ${EXPLICIT_SIMD_OPT_FLAG} ${ARGN} )
9
21
check_flag(ADD_MISC_MATH_BASIC_OPS_OPT_FLAG ${MISC_MATH_BASIC_OPS_OPT_FLAG} ${ARGN} )
10
22
11
- if (LLVM_COMPILER_IS_GCC_COMPATIBLE )
23
+ if (LLVM_LIBC_COMPILER_IS_GCC_COMPATIBLE )
12
24
if (ADD_FMA_FLAG)
13
25
if (LIBC_TARGET_ARCHITECTURE_IS_X86_64)
14
26
list (APPEND compile_options "-mavx2" )
@@ -96,7 +108,7 @@ function(_get_common_compile_options output_var flags)
96
108
97
109
set (compile_options ${LIBC_COMPILE_OPTIONS_DEFAULT} ${compile_flags} ${config_flags} )
98
110
99
- if (LLVM_COMPILER_IS_GCC_COMPATIBLE )
111
+ if (LLVM_LIBC_COMPILER_IS_GCC_COMPATIBLE )
100
112
list (APPEND compile_options "-fpie" )
101
113
102
114
if (LLVM_LIBC_FULL_BUILD)
@@ -210,7 +222,7 @@ function(_get_common_test_compile_options output_var c_test flags)
210
222
${LIBC_TEST_COMPILE_OPTIONS_DEFAULT}
211
223
${compile_flags} )
212
224
213
- if (LLVM_COMPILER_IS_GCC_COMPATIBLE )
225
+ if (LLVM_LIBC_COMPILER_IS_GCC_COMPATIBLE )
214
226
list (APPEND compile_options "-fpie" )
215
227
216
228
if (LLVM_LIBC_FULL_BUILD)
0 commit comments