File tree Expand file tree Collapse file tree 1 file changed +21
-6
lines changed Expand file tree Collapse file tree 1 file changed +21
-6
lines changed Original file line number Diff line number Diff line change @@ -23,12 +23,27 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
23
23
24
24
set (CMAKE_MACOSX_RPATH YES )
25
25
26
- # Ensure that we do not link the _StringProcessing module.
27
- add_compile_options (
28
- $< $< COMPILE_LANGUAGE:Swift> :-Xfrontend>
29
- $< $< COMPILE_LANGUAGE:Swift> :-disable-implicit-string-processing-module-import> )
30
-
31
- # Force single-threaded builds to eliminate the Darwin dependency.
26
+ # Ensure that we do not link the _StringProcessing module. But we can
27
+ # only pass this flag for new-enough compilers that support it.
28
+ file (WRITE "${CMAKE_BINARY_DIR} /tmp/empty-check-string-processing.swift" "" )
29
+ execute_process (
30
+ COMMAND
31
+ "${CMAKE_Swift_COMPILER} "
32
+ -Xfrontend -disable-implicit-string-processing-module-import
33
+ -c - -o /dev/null
34
+ INPUT_FILE
35
+ "${CMAKE_BINARY_DIR} /tmp/empty-check-string-processing.swift"
36
+ OUTPUT_QUIET ERROR_QUIET
37
+ RESULT_VARIABLE
38
+ SWIFT_SUPPORTS_DISABLE_IMPLICIT_STRING_PROCESSING_MODULE_IMPORT )
39
+ if (NOT SWIFT_SUPPORTS_DISABLE_IMPLICIT_STRING_PROCESSING_MODULE_IMPORT )
40
+ add_compile_options (
41
+ $< $< COMPILE_LANGUAGE:Swift> :-Xfrontend>
42
+ $< $< COMPILE_LANGUAGE:Swift> :-disable-implicit-string-processing-module-import> )
43
+ endif ()
44
+
45
+ # Force single-threaded-only syntax trees to eliminate the Darwin
46
+ # dependency in the compiler.
32
47
add_compile_definitions (
33
48
$< $< COMPILE_LANGUAGE:Swift> :SWIFT_SYNTAX_ALWAYS_SINGLE_THREADED>
34
49
)
You can’t perform that action at this time.
0 commit comments