File tree 2 files changed +12
-11
lines changed
2 files changed +12
-11
lines changed Original file line number Diff line number Diff line change @@ -67,6 +67,18 @@ else()
67
67
endif ()
68
68
FetchContent_MakeAvailable(SwiftFoundationICU SwiftFoundation)
69
69
70
+ # Precompute module triple for installation
71
+ if (NOT SwiftFoundation_MODULE_TRIPLE)
72
+ set (module_triple_command "${CMAKE_Swift_COMPILER} " -print-target -info)
73
+ if (CMAKE_Swift_COMPILER_TARGET)
74
+ list (APPEND module_triple_command -target ${CMAKE_Swift_COMPILER_TARGET} )
75
+ endif ()
76
+ execute_process (COMMAND ${module_triple_command} OUTPUT_VARIABLE target_info_json)
77
+ string (JSON module_triple GET "${target_info_json} " "target" "moduleTriple" )
78
+ set (SwiftFoundation_MODULE_TRIPLE "${module_triple} " CACHE STRING "swift module triple used for installed swiftmodule and swiftinterface files" )
79
+ mark_as_advanced (SwiftFoundation_MODULE_TRIPLE)
80
+ endif ()
81
+
70
82
# System dependencies (fail fast if dependencies are missing)
71
83
find_package (LibXml2 REQUIRED)
72
84
find_package (CURL REQUIRED)
Original file line number Diff line number Diff line change @@ -35,17 +35,6 @@ function(_foundation_install_target module)
35
35
set (module_name ${module} )
36
36
endif ()
37
37
38
- if (NOT SwiftFoundation_MODULE_TRIPLE)
39
- set (module_triple_command "${CMAKE_Swift_COMPILER} " -print-target -info)
40
- if (CMAKE_Swift_COMPILER_TARGET)
41
- list (APPEND module_triple_command -target ${CMAKE_Swift_COMPILER_TARGET} )
42
- endif ()
43
- execute_process (COMMAND ${module_triple_command} OUTPUT_VARIABLE target_info_json)
44
- string (JSON module_triple GET "${target_info_json} " "target" "moduleTriple" )
45
- set (SwiftFoundation_MODULE_TRIPLE "${module_triple} " CACHE STRING "swift module triple used for installed swiftmodule and swiftinterface files" )
46
- mark_as_advanced (SwiftFoundation_MODULE_TRIPLE)
47
- endif ()
48
-
49
38
install (FILES $<TARGET_PROPERTY:${module} ,Swift_MODULE_DIRECTORY>/${module_name} .swiftdoc
50
39
DESTINATION lib/${swift} /${swift_os} /${module_name} .swiftmodule
51
40
RENAME ${SwiftFoundation_MODULE_TRIPLE} .swiftdoc)
You can’t perform that action at this time.
0 commit comments