CMake: Apply C++ compile options to Swift compilations

This ensures that we can get all the proper warnings on/off to get the
same diagnostics and other options when loading C++ headers into the
Swift frontend.
This commit is contained in:
Andrew Kaster 2024-08-04 17:12:34 -06:00
commit 1dff3ca0c4
Notes: github-actions[bot] 2024-08-07 00:29:19 +00:00

View file

@ -9,6 +9,7 @@ macro(add_cxx_compile_options)
set(args "")
foreach(arg ${ARGN})
string(APPEND args ${arg}$<SEMICOLON>)
add_compile_options("SHELL:$<$<COMPILE_LANGUAGE:Swift>:-Xcc ${arg}>")
endforeach()
add_compile_options($<$<COMPILE_LANGUAGE:C,CXX,ASM>:${args}>)
endmacro()