Commit 6dee1532 by Soo-Hwan Na Committed by Copybara-Service

PR #1707: Fixup absl_random compile breakage in Apple ARM64 targets

Imported from GitHub PR https://github.com/abseil/abseil-cpp/pull/1707

Switched to append a full string of "-Xarch_x86_64 -maes" instead of " -Xarch_x86_64" "-maes", for example. Now cmake correctly appends -Xarch_x86_64 to each x64 specific compile option, removing the error caused in recent clang releases:

clang++: error: unsupported option '-msse4.1' for target 'arm64-apple-darwin23.5.0'

Merge 83d17537ee70158d627681a0f0c15f15f30ef838 into f46495ea

Merging this change closes #1707

COPYBARA_INTEGRATE_REVIEW=https://github.com/abseil/abseil-cpp/pull/1707 from Royna2544:patch-1 83d17537ee70158d627681a0f0c15f15f30ef838
PiperOrigin-RevId: 651046496
Change-Id: Ifdb3848febeead4fb562a2d9f0fdca2e0aea185d
parent f46495ea
...@@ -42,7 +42,7 @@ if(APPLE AND CMAKE_CXX_COMPILER_ID MATCHES [[Clang]]) ...@@ -42,7 +42,7 @@ if(APPLE AND CMAKE_CXX_COMPILER_ID MATCHES [[Clang]])
string(TOUPPER "${_arch}" _arch_uppercase) string(TOUPPER "${_arch}" _arch_uppercase)
string(REPLACE "X86_64" "X64" _arch_uppercase ${_arch_uppercase}) string(REPLACE "X86_64" "X64" _arch_uppercase ${_arch_uppercase})
foreach(_flag IN LISTS ABSL_RANDOM_HWAES_${_arch_uppercase}_FLAGS) foreach(_flag IN LISTS ABSL_RANDOM_HWAES_${_arch_uppercase}_FLAGS)
list(APPEND ABSL_RANDOM_RANDEN_COPTS "-Xarch_${_arch}" "${_flag}") list(APPEND ABSL_RANDOM_RANDEN_COPTS "-Xarch_${_arch} ${_flag}")
endforeach() endforeach()
endforeach() endforeach()
# If a compiler happens to deal with an argument for a currently unused # If a compiler happens to deal with an argument for a currently unused
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment