[CMake] Globally set sanitizer options Swift targets

For C/CXX targets, sanitizer options are set by 'CMAKE_{C|CXX}_FLAGS' in
HandleLLVMComfig.cmake. However for Swift targets, they are set for each
target. That caused some mismatch issues. Instead set them globally for
Swift targets too.

rdar://142516855
This commit is contained in:
Rintaro Ishizaki
2025-01-13 15:51:29 -08:00
parent b718c6d448
commit 84a09071cb
4 changed files with 35 additions and 33 deletions

View File

@@ -1087,6 +1087,9 @@ endif()
#
swift_common_cxx_warnings()
# Set sanitizer options for Swift compiler.
swift_common_sanitizer_config()
# Check if we're build with MSVC or Clang-cl, as these compilers have similar command line arguments.
if("${CMAKE_C_COMPILER_ID}" STREQUAL "MSVC" OR "${CMAKE_CXX_SIMULATE_ID}" STREQUAL "MSVC")
set(SWIFT_COMPILER_IS_MSVC_LIKE TRUE)