Skip to content

Commit

Permalink
Add -fsized-deallocation compile option (#9218)
Browse files Browse the repository at this point in the history
Summary:
Fb-thrift uses C++17's `operator delete`, which requires `-fsized-deallocation` when building c++ source code with clang and libstdc++.

https://github.com/facebook/hhvm/blob/9832791642981d582d0f29c6d89dba2c879cc43d/third-party/thrift/src/thrift/lib/cpp/ContextStack.cpp#L229-L230

X-link: facebook/hhvm#9218

Differential Revision: D39707592

Pulled By: Atry

fbshipit-source-id: d2074612e9d0cc62b8b74d9e93079641521e852c
  • Loading branch information
Atry authored and facebook-github-bot committed Sep 22, 2022
1 parent c2ac1ac commit 8cc39b7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ find_package(OpenSSL REQUIRED)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID MATCHES "GNU")
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-fsized-deallocation>)
endif()

# Enable modular builds
option(compiler_only "Build the Thrift Compiler only" OFF)
Expand Down

0 comments on commit 8cc39b7

Please sign in to comment.