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 @@ -36,11 +36,25 @@ if(SWIFT_SWIFT_PARSER)
36
36
-enable-library-evolution;
37
37
-emit-module-interface;
38
38
-target;${target}> )
39
-
40
- target_link_libraries ("${library_name} "
41
- PRIVATE
42
- swiftCore
43
- )
39
+
40
+ # Ensure that we do not link the _StringProcessing module. But we can
41
+ # only pass this flag for new-enough compilers that support it.
42
+ file (WRITE "${CMAKE_BINARY_DIR} /tmp/empty-check-string-processing.swift" "" )
43
+ execute_process (
44
+ COMMAND
45
+ "${CMAKE_Swift_COMPILER} "
46
+ -Xfrontend -disable-implicit-string-processing-module-import
47
+ -c - -o /dev/null
48
+ INPUT_FILE
49
+ "${CMAKE_BINARY_DIR} /tmp/empty-check-string-processing.swift"
50
+ OUTPUT_QUIET ERROR_QUIET
51
+ RESULT_VARIABLE
52
+ SWIFT_SUPPORTS_DISABLE_IMPLICIT_STRING_PROCESSING_MODULE_IMPORT )
53
+ if (NOT SWIFT_SUPPORTS_DISABLE_IMPLICIT_STRING_PROCESSING_MODULE_IMPORT )
54
+ add_compile_options (
55
+ $< $< COMPILE_LANGUAGE:Swift> :-Xfrontend>
56
+ $< $< COMPILE_LANGUAGE:Swift> :-disable-implicit-string-processing-module-import> )
57
+ endif ()
44
58
45
59
swift_install_in_component (TARGETS "${library_name} "
46
60
RUNTIME
You can’t perform that action at this time.
0 commit comments