chore(cmake): enhance CMake configuration for Abseil and yaml-cpp

- Made ABSL_TARGETS available to the rest of the project via include(), improving modularity.
- Added MSVC-specific compile options for yaml-cpp to address exception handling warnings.

Benefits:
- Streamlined integration of Abseil targets across the project.
- Improved compatibility and reduced warnings for yaml-cpp on MSVC.
This commit is contained in:
scawful
2025-10-11 10:49:40 -04:00
parent a8d49306e5
commit feeb16cb9f
3 changed files with 55 additions and 24 deletions

View File

@@ -151,10 +151,22 @@ list(GET _PROTOBUF_INCLUDE_DIRS 0 _gRPC_PROTOBUF_WELLKNOWN_INCLUDE_DIR)
# Export Abseil targets from gRPC's bundled abseil for use by the rest of the project
# This ensures version compatibility between gRPC and our project
# Note: Order matters for some linkers - put base libraries first
set(
ABSL_TARGETS
absl::base
absl::config
absl::core_headers
absl::utility
absl::memory
absl::container_memory
absl::strings
absl::str_format
absl::cord
absl::hash
absl::time
absl::status
absl::statusor
absl::flags
absl::flags_parse
absl::flags_usage
@@ -164,32 +176,21 @@ set(
absl::flags_program_name
absl::flags_config
absl::flags_reflection
absl::status
absl::statusor
absl::examine_stack
absl::stacktrace
absl::base
absl::config
absl::core_headers
absl::failure_signal_handler
absl::flat_hash_map
absl::cord
absl::hash
absl::synchronization
absl::time
absl::symbolize
absl::container_memory
absl::memory
absl::utility
PARENT_SCOPE
)
# Only expose absl::int128 when it's supported without warnings
if(NOT WIN32)
list(APPEND ABSL_TARGETS absl::int128)
set(ABSL_TARGETS ${ABSL_TARGETS} PARENT_SCOPE)
endif()
# ABSL_TARGETS is now available to the rest of the project via include()
# Fix Abseil ARM64 macOS compile flags (remove x86-specific flags)
if(APPLE AND DEFINED CMAKE_OSX_ARCHITECTURES AND CMAKE_OSX_ARCHITECTURES STREQUAL "arm64")
foreach(_absl_target IN ITEMS absl_random_internal_randen_hwaes absl_random_internal_randen_hwaes_impl)