Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Abseil to 20230125.3, raise minimum requirements to CMake 3.12 and C++14 #1169

Merged
merged 1 commit into from
May 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@ if(WIN32)
cmake_minimum_required(VERSION 3.15)
cmake_policy(SET CMP0091 NEW)
else()
cmake_minimum_required(VERSION 3.5)
if(POLICY CMP0069)
cmake_policy(SET CMP0069 NEW)
endif()
cmake_minimum_required(VERSION 3.12)
endif()

project(libsfizz
Expand Down
3 changes: 1 addition & 2 deletions cmake/SfizzConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@ include(CheckCXXCompilerFlag)
include(CheckCXXSourceCompiles)
include(GNUWarnings)

# TODO:
# C++14 is the minimum standard version required by Abseil LTS 20230125.1 and later, see
# https://github.com/abseil/abseil-cpp/releases/tag/20230125.1
set(CMAKE_CXX_STANDARD 11 CACHE STRING "C++ standard to be used")
set(CMAKE_CXX_STANDARD 14 CACHE STRING "C++ standard to be used")
set(CMAKE_C_STANDARD 99 CACHE STRING "C standard to be used")

# Export the compile_commands.json file
Expand Down
16 changes: 6 additions & 10 deletions cmake/SfizzDeps.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -52,20 +52,16 @@ if(APPLE)
endif()

# Add Abseil

# WARNING: When enabling SFIZZ_USE_SYSTEM_ABSEIL and the installed
# library was built with C++17, the build fails if CMAKE_CXX_STANDARD
# is set to 14. This happens at least with Archlinux and FreeBSD.
# We'll need also to check if to set ABSL_PROPAGATE_CXX_STD=OFF in future versions.
if(SFIZZ_USE_SYSTEM_ABSEIL)
find_package(absl REQUIRED)
if(absl_FOUND)
# FIXME:
# 1. Workaround for silent Abseil module, see #1117
# Workaround for silent Abseil module, see #1117
message(STATUS "Found system Abseil libraries, version ${absl_VERSION}")
# 2. The current Abseil LTS version requires at least C++14, see
# https://github.com/abseil/abseil-cpp/releases/tag/20230125.1
# but results in errors by using std::string_view, optional etc.,
# due to an ABI incompatibility with the installed system library
# when built with C++17. This is happens at least with Archlinux and FreeBSD,
# so in cases like these a -D CMAKE_CXX_STANDARD=17 is required.
# 3. We'll need also to check if to set ABSL_PROPAGATE_CXX_STD=OFF
# in future versions because the above issue.

# Make Abseil to be usable globally also for plugins project:
# in CMake 3.24+ we can use `find_package(absl REQUIRED GLOBAL)`,
Expand Down
2 changes: 1 addition & 1 deletion external/abseil-cpp
Submodule abseil-cpp updated 527 files