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: 8c1a4251e48b8802aab1606f50a972ca945b7da2
  • Loading branch information
Atry authored and facebook-github-bot committed Sep 22, 2022
1 parent f9c2ee0 commit 50c7447
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions thrift/lib/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,12 @@ 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 $<$<COMPILE_LANGUAGE:CXX>:-fsized-deallocation>)
endif()
target_link_libraries(
async
PUBLIC
Expand Down

0 comments on commit 50c7447

Please sign in to comment.