File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -834,6 +834,19 @@ if(CMAKE_C_COMPILER_ID MATCHES Clang)
834834 add_compile_options ($<$<COMPILE_LANGUAGE:CXX>:-Werror=c++98-compat-extra-semi>)
835835endif ()
836836
837+ if (CMAKE_CXX_COMPILER_ID MATCHES Clang)
838+ include (CheckCXXCompilerFlag)
839+ # Check for '-fsized-deallocation', which we need in IRGen. Clang presumably
840+ # adds this flag as a requirement for C++14+ to avoid a potential source
841+ # compatibility issue with C++11 where the 2-parameter `operator delete` was
842+ # used for placement deletion.
843+ check_cxx_compiler_flag("-fsized-deallocation"
844+ CXX_SUPPORTS_FSIZED_DEALLOCATION)
845+ if (CXX_SUPPORTS_FSIZED_DEALLOCATION)
846+ add_compile_options ($<$<COMPILE_LANGUAGE:CXX>:-fsized-deallocation>)
847+ endif ()
848+ endif ()
849+
837850option (SWIFT_BUILD_SWIFT_SYNTAX
838851 "Enable building swift syntax"
839852 FALSE )
Original file line number Diff line number Diff line change @@ -76,8 +76,6 @@ add_swift_host_library(swiftIRGen STATIC
7676 transformutils
7777 irprinter
7878)
79- target_compile_options (swiftIRGen PRIVATE
80- $<$<AND :$<PLATFORM_ID:Linux>,$<CXX_COMPILER_ID:Clang>>:-fsized-deallocation>)
8179target_link_libraries (swiftIRGen INTERFACE
8280 clangCodeGen
8381 clangAST)
You can’t perform that action at this time.
0 commit comments