Skip to content

Commit df48bbf

Browse files
mszabo-wikiafacebook-github-bot
authored andcommitted
Add CMake option to force using libc++ (#9570)
Summary: I've been unable to build HHVM master against libstdc++ with GCC 14 or clang 18. Since most distros use libstdc++ as the default C++ standard library, we need an option to force using libc++ instead. Remove the existing option to force building against libstdc++ when using clang, which was added 10 years ago in cc07cb5 to help workaround GCC 5 bugs and seems no longer relevant. Pull Request resolved: #9570 Reviewed By: Wilfred Differential Revision: D67921607 fbshipit-source-id: af895431d5a079b2c14f694dbeb1bc035b75899b
1 parent 68fbf37 commit df48bbf

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

CMake/HPHPCompiler.cmake

+2-2
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,8 @@ if (${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang" OR ${CMAKE_CXX_COMPILER_ID} STREQU
132132
endif()
133133
endif()
134134

135-
if(CLANG_FORCE_LIBSTDCXX)
136-
list(APPEND GENERAL_CXX_OPTIONS "stdlib=libstdc++")
135+
if(CLANG_FORCE_LIBCPP)
136+
list(APPEND GENERAL_CXX_OPTIONS "stdlib=libc++")
137137
endif()
138138
else() # using GCC
139139
list(APPEND DISABLED_NAMED_WARNINGS

CMake/Options.cmake

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ option(FORCE_TP_JEMALLOC "Always build and statically link jemalloc instead of u
1515

1616
option(ENABLE_HHPROF "Enable HHProf" OFF)
1717

18-
option(CLANG_FORCE_LIBSTDCXX "Force libstdc++ when building against Clang/LLVM" OFF)
18+
option(CLANG_FORCE_LIBCPP "Force using libc++ as the C++ standard library" OFF)
1919

2020
option(USE_TCMALLOC "Use tcmalloc (if jemalloc is not used)" ON)
2121
option(USE_GOOGLE_HEAP_PROFILER "Use Google heap profiler" OFF)

0 commit comments

Comments
 (0)