@@ -42,24 +42,23 @@ option(SWIFT_SYNTAX_ENABLE_WMO_PRE_3_26
42
42
$<IF:$<AND :$<NOT :$<CONFIG:Debug>>,$<PLATFORM_ID:Darwin>>,YES ,NO >)
43
43
44
44
include (AddSwiftHostLibrary)
45
- include (SwiftCompilerCapability)
46
45
47
- # Don't link with 'string-processing' and 'backtracing'.
48
- swift_supports_implicit_module( "string-processing" SWIFT_SUPPORTS_DISABLE_IMPLICIT_STRING_PROCESSING_MODULE_IMPORT)
49
- swift_supports_implicit_module( "backtracing" SWIFT_SUPPORTS_DISABLE_IMPLICIT_BACKTRACING_MODULE_IMPORT )
50
- if (SWIFT_SUPPORTS_DISABLE_IMPLICIT_STRING_PROCESSING_MODULE_IMPORT)
51
- add_compile_options ( "$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xfrontend -disable-implicit-string-processing-module-import>" )
52
- endif ()
53
- if (SWIFT_SUPPORTS_DISABLE_IMPLICIT_BACKTRACING_MODULE_IMPORT)
54
- add_compile_options ( "$<$<COMPILE_LANGUAGE:Swift>:SHELL: -Xfrontend -disable-implicit-backtracing-module-import>" )
55
- endif ()
56
-
57
- # SWIFTSYNTAX_EMIT_MODULE is TRUE by default
58
- if ( NOT DEFINED SWIFTSYNTAX_EMIT_MODULE )
59
- set (SWIFTSYNTAX_EMIT_MODULE TRUE )
60
- endif ()
61
- if (SWIFTSYNTAX_EMIT_MODULE)
62
- swift_get_package_cmo_support(SWIFT_PACKAGE_CMO_SUPPORT )
46
+ # Ensure that we do not link the _StringProcessing module. But we can
47
+ # only pass this flag for new-enough compilers that support it.
48
+ file (WRITE " ${CMAKE_BINARY_DIR} /tmp/empty-check-string-processing.swift" "" )
49
+ execute_process (
50
+ COMMAND
51
+ " ${CMAKE_Swift_COMPILER} "
52
+ -Xfrontend -disable-implicit- string -processing-module-import
53
+ -Xfrontend -parse-stdlib
54
+ -typecheck " ${CMAKE_BINARY_DIR} /tmp/empty-check-string-processing.swift"
55
+ OUTPUT_QUIET ERROR_QUIET
56
+ RESULT_VARIABLE
57
+ SWIFT_SUPPORTS_DISABLE_IMPLICIT_STRING_PROCESSING_MODULE_IMPORT )
58
+ if ( NOT SWIFT_SUPPORTS_DISABLE_IMPLICIT_STRING_PROCESSING_MODULE_IMPORT )
59
+ add_compile_options (
60
+ $<$<COMPILE_LANGUAGE:Swift>:-Xfrontend>
61
+ $<$<COMPILE_LANGUAGE:Swift>:-disable-implicit- string -processing-module-import> )
63
62
endif ()
64
63
65
64
# Determine the module triple.
0 commit comments