File tree 1 file changed +20
-2
lines changed
1 file changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,19 @@ macro(swift_supports_implicit_module module_name out_var)
21
21
)
22
22
endmacro ()
23
23
24
+ function (swift_get_swiftlang_version out_var)
25
+ execute_process (
26
+ COMMAND "${CMAKE_Swift_COMPILER} " -version
27
+ OUTPUT_VARIABLE output ERROR_VARIABLE output
28
+ RESULT_VARIABLE result
29
+ TIMEOUT 10
30
+ )
31
+
32
+ if (output MATCHES [[swiftlang-([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)]])
33
+ set ("${out_var} " "${CMAKE_MATCH_1} " PARENT_SCOPE)
34
+ endif ()
35
+ endfunction ()
36
+
24
37
# Get "package cross-module-optimization" compiler arguments suitable for the compiler.
25
38
function (swift_get_package_cmo_support out_var)
26
39
# > 6.0 : Fixed feature.
@@ -42,8 +55,13 @@ function(swift_get_package_cmo_support out_var)
42
55
-Xfrontend -experimental-package-bypass-resilience
43
56
)
44
57
if (result)
45
- set (${out_var} EXPERIMENTAL PARENT_SCOPE)
46
- return ()
58
+ # Package CMO is implmented in Xcode 16 Beta 4 (swiftlang-6.0.0.6.8) or later.
59
+ # Consider it's not supported in non Xcode toolchain with "-experimental" options.
60
+ swift_get_swiftlang_version(swiftlang_version)
61
+ if (swiftlang_version AND swiftlang_version VERSION_GREATER_EQUAL 6.0.0.6)
62
+ set (${out_var} EXPERIMENTAL PARENT_SCOPE)
63
+ return ()
64
+ endif ()
47
65
endif ()
48
66
49
67
# < 6.0 : Not supported.
You can’t perform that action at this time.
0 commit comments