diff --git a/CMakeLists.txt b/CMakeLists.txt index a1312714e..8920fd6f0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 diff --git a/cmake/SfizzConfig.cmake b/cmake/SfizzConfig.cmake index 53823440e..a17feae16 100644 --- a/cmake/SfizzConfig.cmake +++ b/cmake/SfizzConfig.cmake @@ -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 diff --git a/cmake/SfizzDeps.cmake b/cmake/SfizzDeps.cmake index c76e216a1..cc317a95b 100644 --- a/cmake/SfizzDeps.cmake +++ b/cmake/SfizzDeps.cmake @@ -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)`, diff --git a/external/abseil-cpp b/external/abseil-cpp index 273292d1c..c2435f834 160000 --- a/external/abseil-cpp +++ b/external/abseil-cpp @@ -1 +1 @@ -Subproject commit 273292d1cfc0a94a65082ee350509af1d113344d +Subproject commit c2435f8342c2d0ed8101cb43adfd605fdc52dca2