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

Reviewed By: vitaut

Differential Revision: D39707592

Pulled By: Atry

fbshipit-source-id: 46e82a2d16ce095ac60b73396a8baa1d54bc57c9
  • Loading branch information
Atry authored and facebook-github-bot committed Sep 23, 2022
1 parent c433a9e commit 10b0fb2
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions thrift/lib/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,16 @@ add_library(
async/TUnframedAsyncChannel.cpp
server/TServerObserver.cpp
)
if (
CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR
CMAKE_CXX_COMPILER_ID STREQUAL "GNU"
)
target_compile_options(
async
PUBLIC
$<$<COMPILE_LANGUAGE:CXX>:-fsized-deallocation>
)
endif()
target_link_libraries(
async
PUBLIC
Expand Down

0 comments on commit 10b0fb2

Please sign in to comment.