[clang] Handle __declspec() attributes in using
[llvm-project.git] / compiler-rt / cmake / crt-config-ix.cmake
blob066a0edbc567f5025941e950be35c38d062b3753
1 include(BuiltinTests)
2 include(CheckCSourceCompiles)
4 # Make all the tests only check the compiler
5 set(TEST_COMPILE_ONLY On)
7 builtin_check_c_compiler_flag(-fPIC                 COMPILER_RT_HAS_FPIC_FLAG)
8 builtin_check_c_compiler_flag(-std=c11              COMPILER_RT_HAS_STD_C11_FLAG)
9 builtin_check_c_compiler_flag(-Wno-pedantic         COMPILER_RT_HAS_WNO_PEDANTIC)
10 builtin_check_c_compiler_flag(-fno-lto              COMPILER_RT_HAS_FNO_LTO_FLAG)
11 builtin_check_c_compiler_flag(-fno-profile-generate COMPILER_RT_HAS_FNO_PROFILE_GENERATE_FLAG)
12 builtin_check_c_compiler_flag(-fno-profile-instr-generate COMPILER_RT_HAS_FNO_PROFILE_INSTR_GENERATE_FLAG)
13 builtin_check_c_compiler_flag(-fno-profile-instr-use COMPILER_RT_HAS_FNO_PROFILE_INSTR_USE_FLAG)
15 if(ANDROID)
16   set(OS_NAME "Android")
17 else()
18   set(OS_NAME "${CMAKE_SYSTEM_NAME}")
19 endif()
21 set(ARM64 aarch64)
22 set(ARM32 arm armhf)
23 set(HEXAGON hexagon)
24 set(X86 i386)
25 set(X86_64 x86_64)
26 set(LOONGARCH64 loongarch64)
27 set(PPC32 powerpc powerpcspe)
28 set(PPC64 powerpc64 powerpc64le)
29 set(RISCV32 riscv32)
30 set(RISCV64 riscv64)
31 set(VE ve)
33 set(ALL_CRT_SUPPORTED_ARCH ${X86} ${X86_64} ${ARM32} ${ARM64} ${PPC32}
34     ${PPC64} ${RISCV32} ${RISCV64} ${VE} ${HEXAGON} ${LOONGARCH64})
36 include(CompilerRTUtils)
38 if(NOT APPLE)
39   if(COMPILER_RT_CRT_STANDALONE_BUILD)
40     test_targets()
41   endif()
42   # Architectures supported by compiler-rt crt library.
43   filter_available_targets(CRT_SUPPORTED_ARCH ${ALL_CRT_SUPPORTED_ARCH})
44   message(STATUS "Supported architectures for crt: ${CRT_SUPPORTED_ARCH}")
45 endif()
47 if (CRT_SUPPORTED_ARCH AND OS_NAME MATCHES "Linux" AND NOT LLVM_USE_SANITIZER)
48   set(COMPILER_RT_HAS_CRT TRUE)
49 else()
50   set(COMPILER_RT_HAS_CRT FALSE)
51 endif()