Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -834,6 +834,19 @@ if(CMAKE_C_COMPILER_ID MATCHES Clang)
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-Werror=c++98-compat-extra-semi>)
endif()

if(CMAKE_CXX_COMPILER_ID MATCHES Clang)
include(CheckCXXCompilerFlag)
# Check for '-fsized-deallocation', which we need in IRGen. Clang presumably
# adds this flag as a requirement for C++14+ to avoid a potential source
# compatibility issue with C++11 where the 2-parameter `operator delete` was
# used for placement deletion.
check_cxx_compiler_flag("-fsized-deallocation"
CXX_SUPPORTS_FSIZED_DEALLOCATION)
if(CXX_SUPPORTS_FSIZED_DEALLOCATION)
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-fsized-deallocation>)
endif()
endif()

option(SWIFT_BUILD_SWIFT_SYNTAX
"Enable building swift syntax"
FALSE)
Expand Down
2 changes: 0 additions & 2 deletions lib/IRGen/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,6 @@ add_swift_host_library(swiftIRGen STATIC
transformutils
irprinter
)
target_compile_options(swiftIRGen PRIVATE
$<$<AND:$<PLATFORM_ID:Linux>,$<CXX_COMPILER_ID:Clang>>:-fsized-deallocation>)
target_link_libraries(swiftIRGen INTERFACE
clangCodeGen
clangAST)
Expand Down