trying ABSL_ENABLE_CONSTANT_INIT_V2 flag

Signed-off-by: Pratik Mankawde <3397372+pratikmankawde@users.noreply.github.com>
This commit is contained in:
Pratik Mankawde
2025-12-09 17:11:55 +00:00
parent 9ec5ef96f8
commit 2b1479fa99
2 changed files with 8 additions and 9 deletions

5
cmake/AbseilFix.cmake Normal file
View File

@@ -0,0 +1,5 @@
# This file is included by Conan's toolchain file.
# We set the required CMake variable as a CACHE variable to ensure
# it takes effect during the configure step.
set(ABSL_ENABLE_CONSTANT_INIT_V2 "OFF" CACHE BOOL "Disable Abseil's V2 constant init logic to fix compiler errors.")

View File

@@ -35,6 +35,9 @@ include(default)
tools.build:cxxflags+=['{{sanitizer_flags}} {{extra_cxxflags}}']
tools.build:sharedlinkflags+=['{{sanitizer_flags}}']
tools.build:exelinkflags+=['{{sanitizer_flags}}']
tools.cmake.cmaketoolchain:user_toolchain+=['cmake/AbseilFix.cmake']
tools.build:defines+=['ABSL_ENABLE_CONSTANT_INIT_V2=0']
tools.build:cflags+=['-DABSL_ENABLE_CONSTANT_INIT_V2=0']
{% endif %}
{% elif compiler == "apple-clang" or compiler == "clang" %}
{% if "Address" in sanitizers or "Thread" in sanitizers or "UndefinedBehavior" in sanitizers %}
@@ -63,12 +66,3 @@ include(default)
{% endif %}
tools.info.package_id:confs+=["tools.build:cxxflags", "tools.build:exelinkflags", "tools.build:sharedlinkflags", "tools.build:defines", "tools.cmake.cmaketoolchain:user_toolchain"]
[options]
{% if compiler == "gcc" %}
{% if sanitizers == "Address" or sanitizers == "Thread" %}
abseil/*:ABSL_ENABLE_CONSTANT_INIT_V2=OFF
abseil/*:defines+=['ABSL_ENABLE_CONSTANT_INIT_V2=OFF']
abseil/*:extra_cxxflags+="-DABSL_ENABLE_CONSTANT_INIT_V2=OFF"
{% endif %}
{% endif %}