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)
834
834
add_compile_options ($<$<COMPILE_LANGUAGE:CXX>:-Werror=c++98-compat-extra-semi>)
835
835
endif ()
836
836
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
+
837
850
option (SWIFT_BUILD_SWIFT_SYNTAX
838
851
"Enable building swift syntax"
839
852
FALSE )
Original file line number Diff line number Diff line change @@ -76,8 +76,6 @@ add_swift_host_library(swiftIRGen STATIC
76
76
transformutils
77
77
irprinter
78
78
)
79
- target_compile_options (swiftIRGen PRIVATE
80
- $<$<AND :$<PLATFORM_ID:Linux>,$<CXX_COMPILER_ID:Clang>>:-fsized-deallocation>)
81
79
target_link_libraries (swiftIRGen INTERFACE
82
80
clangCodeGen
83
81
clangAST)
You can’t perform that action at this time.
0 commit comments