CMake: Silence the loudest warnings for generating Swift interop headers

And modernize the cmake_parse_arguments() call at the top.

Ideally, we would pull these flags from the target we're generating
for, but the current CMake setup makes that prohibitively infeasible.
This commit is contained in:
Andrew Kaster 2024-08-05 20:32:07 -06:00 committed by Andrew Kaster
parent 1dff3ca0c4
commit e7a9126f81
Notes: github-actions[bot] 2024-08-07 00:29:14 +00:00

View file

@ -23,7 +23,7 @@ function(_swift_generate_cxx_header target header)
return()
endif()
cmake_parse_arguments(ARG "" "" "SEARCH_PATHS;MODULE_NAME;CXX_STD_VERSION" ${ARGN})
cmake_parse_arguments(PARSE_ARGV 2 "ARG" "" "MODULE_NAME;CXX_STD_VERSION" "SEARCH_PATHS")
if(NOT ARG_MODULE_NAME)
set(target_module_name $<TARGET_PROPERTY:${target},Swift_MODULE_NAME>)
@ -70,6 +70,9 @@ function(_swift_generate_cxx_header target header)
${_SwiftSources}
${SDK_FLAGS}
${CXX_STD_FLAGS}
-Xcc -Wno-unqualified-std-cast-call
-Xcc -Wno-user-defined-literals
-Xcc -Wno-unknown-warning-option
-module-name "${ARG_MODULE_NAME}"
-cxx-interoperability-mode=default
-emit-clang-header-path ${header_path}