File tree Expand file tree Collapse file tree 1 file changed +19
-5
lines changed
lib/CompilerPluginSupport Expand file tree Collapse file tree 1 file changed +19
-5
lines changed Original file line number Diff line number Diff line change @@ -57,11 +57,25 @@ if(SWIFT_SWIFT_PARSER)
57
57
-emit-module-interface-path;
58
58
"${module_interface_file} " ;
59
59
-target;${target}> )
60
-
61
- target_link_libraries ("${library_name} "
62
- PRIVATE
63
- swiftCore
64
- )
60
+
61
+ # Ensure that we do not link the _StringProcessing module. But we can
62
+ # only pass this flag for new-enough compilers that support it.
63
+ file (WRITE "${CMAKE_BINARY_DIR} /tmp/empty-check-string-processing.swift" "" )
64
+ execute_process (
65
+ COMMAND
66
+ "${CMAKE_Swift_COMPILER} "
67
+ -Xfrontend -disable-implicit-string-processing-module-import
68
+ -c - -o /dev/null
69
+ INPUT_FILE
70
+ "${CMAKE_BINARY_DIR} /tmp/empty-check-string-processing.swift"
71
+ OUTPUT_QUIET ERROR_QUIET
72
+ RESULT_VARIABLE
73
+ SWIFT_SUPPORTS_DISABLE_IMPLICIT_STRING_PROCESSING_MODULE_IMPORT )
74
+ if (NOT SWIFT_SUPPORTS_DISABLE_IMPLICIT_STRING_PROCESSING_MODULE_IMPORT )
75
+ add_compile_options (
76
+ $< $< COMPILE_LANGUAGE:Swift> :-Xfrontend>
77
+ $< $< COMPILE_LANGUAGE:Swift> :-disable-implicit-string-processing-module-import> )
78
+ endif ()
65
79
66
80
swift_install_in_component (TARGETS "${library_name} "
67
81
RUNTIME
You can’t perform that action at this time.
0 commit comments