Force C++20 for folly

This commit is contained in:
Marcus Holland-Moritz 2023-05-20 20:16:06 +02:00
parent 2a0ac12034
commit 032c69cbd9

View File

@ -40,6 +40,9 @@ option(STATIC_BUILD_DO_NOT_USE "try static build (experimental)" OFF)
set(default_build_type "Release") set(default_build_type "Release")
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message(STATUS "Setting build type to '${default_build_type}'") message(STATUS "Setting build type to '${default_build_type}'")
set(CMAKE_BUILD_TYPE set(CMAKE_BUILD_TYPE
@ -222,12 +225,21 @@ set(compiler_only
# TODO: this is due to a bug in folly's Portability.h # TODO: this is due to a bug in folly's Portability.h
add_compile_definitions(FOLLY_CFG_NO_COROUTINES) add_compile_definitions(FOLLY_CFG_NO_COROUTINES)
set(
CXX_STD "gnu++20"
CACHE STRING
"The C++ standard argument to pass to the compiler."
)
add_subdirectory(folly EXCLUDE_FROM_ALL) add_subdirectory(folly EXCLUDE_FROM_ALL)
add_subdirectory(fbthrift EXCLUDE_FROM_ALL) add_subdirectory(fbthrift EXCLUDE_FROM_ALL)
if(NOT (ZSTD_FOUND AND PREFER_SYSTEM_ZSTD)) if(NOT (ZSTD_FOUND AND PREFER_SYSTEM_ZSTD))
add_subdirectory(zstd/build/cmake EXCLUDE_FROM_ALL) add_subdirectory(zstd/build/cmake EXCLUDE_FROM_ALL)
endif() endif()
set_property(TARGET folly PROPERTY CXX_STANDARD 20)
set_property(TARGET folly_base PROPERTY CXX_STANDARD 20)
set(ZSTD_LIBRARY_RELEASE set(ZSTD_LIBRARY_RELEASE
"ZSTD_LIBRARY_RELEASE-NOTFOUND" "ZSTD_LIBRARY_RELEASE-NOTFOUND"
CACHE FILEPATH "don't build folly with zstd" FORCE) CACHE FILEPATH "don't build folly with zstd" FORCE)