-
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use ABSL_PROPAGATE_CXX_STD=ON and set C++17 also on windows
switches to the non-deprecated option, but also needs to patch upstream to actually propagate C++17 instead of C++11, compare: https://github.com/abseil/abseil-cpp/blob/20211102.0/CMake/AbseilHelpers.cmake#L257-L273
- Loading branch information
1 parent
2f99657
commit adeffe5
Showing
10 changed files
with
89 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
recipe/patches/0001-patch-out-the-build-issue-on-clang4-osx.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
recipe/patches/0002-fix-for-linking-to-the-CoreFoundation-framework-on-O.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
recipe/patches/0003-remove-ignore-4221-from-ABSL_MSVC_LINKOPTS.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
recipe/patches/0004-alphabetize-ABSL_INTERNAL_DLL_TARGETS.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
recipe/patches/0006-propagate-requirement-of-C-17-to-consumers.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
From 3b748914f9a91b1796f15b8a531c2b41033a602d Mon Sep 17 00:00:00 2001 | ||
From: "H. Vetinari" <h.vetinari@gmx.com> | ||
Date: Wed, 2 Mar 2022 12:34:33 +1100 | ||
Subject: [PATCH 6/7] propagate requirement of C++17 to consumers | ||
|
||
--- | ||
CMake/AbseilHelpers.cmake | 2 +- | ||
1 file changed, 1 insertion(+), 1 deletion(-) | ||
|
||
diff --git a/CMake/AbseilHelpers.cmake b/CMake/AbseilHelpers.cmake | ||
index f2ce567..6758890 100644 | ||
--- a/CMake/AbseilHelpers.cmake | ||
+++ b/CMake/AbseilHelpers.cmake | ||
@@ -258,7 +258,7 @@ Cflags: -I\${includedir}${PC_CFLAGS}\n") | ||
# Abseil libraries require C++11 as the current minimum standard. | ||
# Top-level application CMake projects should ensure a consistent C++ | ||
# standard for all compiled sources by setting CMAKE_CXX_STANDARD. | ||
- target_compile_features(${_NAME} PUBLIC cxx_std_11) | ||
+ target_compile_features(${_NAME} PUBLIC cxx_std_17) | ||
else() | ||
# Note: This is legacy (before CMake 3.8) behavior. Setting the | ||
# target-level CXX_STANDARD property to ABSL_CXX_STANDARD (which is | ||
-- | ||
2.35.1.windows.2 | ||
|
42 changes: 42 additions & 0 deletions
42
recipe/patches/0007-also-set-target_compile_features-for-abseil_dll.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
From f60a3404b0e21b56220ecef491db76bbddf32639 Mon Sep 17 00:00:00 2001 | ||
From: "H. Vetinari" <h.vetinari@gmx.com> | ||
Date: Wed, 2 Mar 2022 13:10:15 +1100 | ||
Subject: [PATCH 7/7] also set target_compile_features for abseil_dll | ||
|
||
--- | ||
CMake/AbseilDll.cmake | 19 +++++++++++++++++++ | ||
1 file changed, 19 insertions(+) | ||
|
||
diff --git a/CMake/AbseilDll.cmake b/CMake/AbseilDll.cmake | ||
index aec198e..5cbf5d0 100644 | ||
--- a/CMake/AbseilDll.cmake | ||
+++ b/CMake/AbseilDll.cmake | ||
@@ -538,6 +538,25 @@ function(absl_make_dll) | ||
PRIVATE | ||
${ABSL_DEFAULT_LINKOPTS} | ||
) | ||
+ | ||
+ if(ABSL_PROPAGATE_CXX_STD) | ||
+ # Abseil libraries require C++11 as the current minimum standard. | ||
+ # Top-level application CMake projects should ensure a consistent C++ | ||
+ # standard for all compiled sources by setting CMAKE_CXX_STANDARD. | ||
+ target_compile_features(abseil_dll PUBLIC cxx_std_17) | ||
+ else() | ||
+ # Note: This is legacy (before CMake 3.8) behavior. Setting the | ||
+ # target-level CXX_STANDARD property to ABSL_CXX_STANDARD (which is | ||
+ # initialized by CMAKE_CXX_STANDARD) should have no real effect, since | ||
+ # that is the default value anyway. | ||
+ # | ||
+ # CXX_STANDARD_REQUIRED does guard against the top-level CMake project | ||
+ # not having enabled CMAKE_CXX_STANDARD_REQUIRED (which prevents | ||
+ # "decaying" to an older standard if the requested one isn't available). | ||
+ set_property(TARGET abseil_dll PROPERTY CXX_STANDARD ${ABSL_CXX_STANDARD}) | ||
+ set_property(TARGET abseil_dll PROPERTY CXX_STANDARD_REQUIRED ON) | ||
+ endif() | ||
+ | ||
set_property(TARGET abseil_dll PROPERTY LINKER_LANGUAGE "CXX") | ||
target_include_directories( | ||
abseil_dll | ||
-- | ||
2.35.1.windows.2 | ||
|