@@ -29,32 +29,16 @@ if(NOT SwiftFoundation_MODULE_TRIPLE)
29
29
endif ()
30
30
31
31
if (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" )
40
34
set (SwiftFoundation_ARCH "${module_arch} " CACHE STRING "Arch folder name used to install libraries" )
41
35
mark_as_advanced (SwiftFoundation_ARCH )
42
36
message (CONFIGURE_LOG "Swift arch: ${SwiftFoundation_ARCH} " )
43
37
endif ()
44
38
45
39
if (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" )
58
42
set (SwiftFoundation_PLATFORM "${swift_platform} " CACHE STRING "Platform folder name used to install libraries" )
59
43
mark_as_advanced (SwiftFoundation_PLATFORM )
60
44
message (CONFIGURE_LOG "Swift platform: ${SwiftFoundation_PLATFORM} " )
0 commit comments