fix: Fix clang build (#1288)

Issue #561
This commit is contained in:
Joey Parrish 2023-10-18 16:47:09 -07:00 committed by GitHub
parent 1e9b251be8
commit bcc275454d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 0 deletions

View File

@ -20,3 +20,15 @@ endif()
# With these set in scope of this folder, load the library's own CMakeLists.txt. # With these set in scope of this folder, load the library's own CMakeLists.txt.
add_subdirectory(source) add_subdirectory(source)
# Clang builds of absl::time fail due to the inclusion of -Wconversion without
# -Wno-implicit-int-conversion. However, we can't add that with
# add_compile_options beforehand, because those flags go in before absl's
# -Wconversion flag gets added. We can, however, add
# -Wno-implicit-int-conversion to each necessary target after it is defined.
# This will append after absl's own flags.
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
target_compile_options(absl_civil_time PUBLIC -Wno-implicit-int-conversion)
target_compile_options(absl_time PUBLIC -Wno-implicit-int-conversion)
target_compile_options(absl_time_zone PUBLIC -Wno-implicit-int-conversion)
endif()