Files
cmake/Tests/RunCMake/Swift/SwiftModuleNameHyphen-build-check.cmake
Roman Lavrov 933c59ffde Swift: Replace hyphens with underscores in default module name
GetSwiftModuleName() returns the target name verbatim when
Swift_MODULE_NAME is not set, but hyphens are not valid in Swift
module identifiers.  Replace them with underscores so that targets
like swift-syntax get module name swift_syntax automatically.

Issue: #27748
2026-04-27 19:21:29 -04:00

10 lines
423 B
CMake

# The module name should have underscores, not hyphens.
if(NOT actual_stdout MATCHES "-module-name L_hyphen")
string(APPEND RunCMake_TEST_FAILED
"Expected '-module-name L_hyphen', hyphens should be replaced with underscores.\n")
endif()
if(actual_stdout MATCHES "-module-name L-hyphen")
string(APPEND RunCMake_TEST_FAILED
"Found '-module-name L-hyphen', hyphens are not valid in Swift module names.\n")
endif()