@@ -6,7 +6,7 @@ if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
66 cmake_minimum_required (VERSION 3.20.0)
77
88 set (CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)
9- project (CompilerRTBuiltins C ASM)
9+ project (CompilerRTBuiltins C CXX ASM)
1010 set (COMPILER_RT_STANDALONE_BUILD TRUE )
1111 set (COMPILER_RT_BUILTINS_STANDALONE_BUILD TRUE )
1212
@@ -64,6 +64,8 @@ include(CMakePushCheckState)
6464option (COMPILER_RT_BUILTINS_HIDE_SYMBOLS
6565 "Do not export any symbols from the static library." ON )
6666
67+ include_directories (../../../third-party/siphash/include )
68+
6769# TODO: Need to add a mechanism for logging errors when builtin source files are
6870# added to a sub-directory and not this CMakeLists file.
6971set (GENERIC_SOURCES
@@ -803,7 +805,7 @@ else ()
803805 append_list_if(COMPILER_RT_ENABLE_CET -fcf-protection=full BUILTIN_CFLAGS)
804806 endif ()
805807
806- append_list_if(COMPILER_RT_HAS_STD_C11_FLAG -std=c11 BUILTIN_CFLAGS)
808+ append_list_if(COMPILER_RT_HAS_NOSTDINCXX_FLAG -nostdinc++ BUILTIN_CFLAGS)
807809 append_list_if(COMPILER_RT_HAS_WBUILTIN_DECLARATION_MISMATCH_FLAG -Werror=builtin-declaration-mismatch BUILTIN_CFLAGS)
808810
809811 # Don't embed directives for picking any specific CRT
@@ -918,6 +920,8 @@ else ()
918920 SOURCES ${${arch} _SOURCES}
919921 DEFS ${BUILTIN_DEFS}
920922 CFLAGS ${BUILTIN_CFLAGS_${arch} }
923+ C_STANDARD 11
924+ CXX_STANDARD 17
921925 PARENT_TARGET builtins)
922926 cmake_pop_check_state()
923927 endif ()
0 commit comments