[abseil] Configure abseil to use std:: types when feature cxx17 is enabled#11039
[abseil] Configure abseil to use std:: types when feature cxx17 is enabled#11039strega-nil merged 1 commit intomicrosoft:masterfrom cneumann:abseil-cxx17-use-stdlib-types
Conversation
|
Thanks for your PR! Can you please correct the Version field in the CONTROL file? You can get more information from maintainer-guide.md. |
Adds a patch changing macros in absl/base/options.h to always use the std:: namespace types instead of the absl:: namespace replacements (for any, optional, string_view, variant). The upstream version of options.h uses compiler/library feature detection to decide this, but patch fix-lnk2019-error.patch hard codes use of absl:: types, thus rendering setting CMAKE_CXX_STANDARD to 17 in the port file ineffective. Since auto detection is problematic from an ABI point of view (see comments in absl/base/options.h for details), this applies an alternate patch for fix-lnk2019-error.patch when feature cxx17 is enabled.
|
Ah, sorry for missing that. I've updated the version and also updated the commit message to include the port tag and hopefully be a bit clearer about what is being fixed and how. |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
Hmm, I'm having trouble understanding the cause for the failures reported above. For example looking at the details of |
It's not related with this PR, this error will be fixed in PR #11063. |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
This is great, thanks @cneumann :) |
Patches
absl/base/options.htype selection macros to use either value0 (when feature
cxx17is not enabled) to ensure that always absl:: types are used. This was alreadydone by the pre-existing
fix-lnk2019-error.patchin the port.When feature
cxx17is enabled instead value 1 is used to force abseil to usethe std:: types.
Abseil can use
std::any,std::optional,std::string_view, andstd::variantor its own internal replacement types. Which ones are used
is configured by setting macros in
absl/base/options.hto values 0/1/2where 0 means always use
absl::types, 1 is always usestd::types (andrequire a C++17 library), 2 detect if the standard library supports the
types and use them if available (see also comments in
absl/base/options.h).