@@ -29,32 +29,16 @@ if(NOT SwiftFoundation_MODULE_TRIPLE)
2929endif ()
3030
3131if (NOT SwiftFoundation_ARCH)
32- if (CMAKE_Swift_COMPILER_VERSION VERSION_EQUAL 0.0.0 OR CMAKE_Swift_COMPILER_VERSION VERSION_GREATER_EQUAL 6.2)
33- # For newer compilers, we can use the -print-target-info command to get the architecture.
34- string (JSON module_arch GET "${target_info_json} " "target" "arch" )
35- else ()
36- # For older compilers, extract the value from `SwiftFoundation_MODULE_TRIPLE`.
37- string (REGEX MATCH "^[^-]+" module_arch "${SwiftFoundation_MODULE_TRIPLE} " )
38- endif ()
39-
32+ # Use the -print-target-info command to get the architecture.
33+ string (JSON module_arch GET "${target_info_json} " "target" "arch" )
4034 set (SwiftFoundation_ARCH "${module_arch} " CACHE STRING "Arch folder name used to install libraries" )
4135 mark_as_advanced (SwiftFoundation_ARCH)
4236 message (CONFIGURE_LOG "Swift arch: ${SwiftFoundation_ARCH} " )
4337endif ()
4438
4539if (NOT SwiftFoundation_PLATFORM)
46- if (CMAKE_Swift_COMPILER_VERSION VERSION_EQUAL 0.0.0 OR CMAKE_Swift_COMPILER_VERSION VERSION_GREATER_EQUAL 6.2)
47- # For newer compilers, we can use the -print-target-info command to get the platform.
48- string (JSON swift_platform GET "${target_info_json} " "target" "platform" )
49- else ()
50- # For older compilers, compile the value from `CMAKE_SYSTEM_NAME`.
51- if (APPLE )
52- set (swift_platform macosx)
53- else ()
54- set (swift_platform "$<LOWER_CASE:${CMAKE_SYSTEM_NAME} >" )
55- endif ()
56- endif ()
57-
40+ # Use the -print-target-info command to get the platform.
41+ string (JSON swift_platform GET "${target_info_json} " "target" "platform" )
5842 set (SwiftFoundation_PLATFORM "${swift_platform} " CACHE STRING "Platform folder name used to install libraries" )
5943 mark_as_advanced (SwiftFoundation_PLATFORM)
6044 message (CONFIGURE_LOG "Swift platform: ${SwiftFoundation_PLATFORM} " )
0 commit comments