File tree 5 files changed +20
-14
lines changed
5 files changed +20
-14
lines changed Original file line number Diff line number Diff line change @@ -59,6 +59,12 @@ set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
59
59
set (THREADS_PREFER_PTHREAD_FLAG OFF )
60
60
find_package (Threads REQUIRED)
61
61
62
+ set (SWIFT_INSTALL_SUBDIR "$<LOWER_CASE:${CMAKE_SYSTEM_NAME} >" )
63
+ if (NOT CMAKE_SYSTEM_NAME MATCHES "Darwin|Windows" )
64
+ get_swift_host_arch(swift_arch)
65
+ set (SWIFT_INSTALL_SUBDIR "${SWIFT_INSTALL_SUBDIR} /${swift_arch} " )
66
+ endif ()
67
+
62
68
set (SAVED_BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS} )
63
69
set (BUILD_SHARED_LIBS NO )
64
70
add_subdirectory (CoreFoundation EXCLUDE_FROM_ALL )
@@ -99,13 +105,13 @@ if(NOT BUILD_SHARED_LIBS)
99
105
endif ()
100
106
101
107
install (TARGETS CoreFoundation CFXMLInterface
102
- DESTINATION lib/swift_static/$<LOWER_CASE: ${CMAKE_SYSTEM_NAME} > )
108
+ DESTINATION lib/swift_static/${SWIFT_INSTALL_SUBDIR} )
103
109
104
110
if (BUILD_NETWORKING)
105
111
set_property (GLOBAL APPEND PROPERTY Foundation_EXPORTS
106
112
CFURLSessionInterface)
107
113
install (TARGETS CFURLSessionInterface
108
- DESTINATION lib/swift_static/$<LOWER_CASE: ${CMAKE_SYSTEM_NAME} > )
114
+ DESTINATION lib/swift_static/${SWIFT_INSTALL_SUBDIR} )
109
115
endif ()
110
116
endif ()
111
117
Original file line number Diff line number Diff line change @@ -11,5 +11,5 @@ set_target_properties(BlocksRuntime PROPERTIES
11
11
add_library (BlocksRuntime::BlocksRuntime ALIAS BlocksRuntime)
12
12
13
13
install (TARGETS BlocksRuntime
14
- ARCHIVE DESTINATION lib/swift$<$<NOT :$<BOOL :${BUILD_SHARED_LIBS} >>:_static>/$<LOWER_CASE: ${CMAKE_SYSTEM_NAME} >
15
- LIBRARY DESTINATION lib/swift$<$<NOT :$<BOOL :${BUILD_SHARED_LIBS} >>:_static>/$<LOWER_CASE: ${CMAKE_SYSTEM_NAME} > )
14
+ ARCHIVE DESTINATION lib/swift$<$<NOT :$<BOOL :${BUILD_SHARED_LIBS} >>:_static>/${SWIFT_INSTALL_SUBDIR}
15
+ LIBRARY DESTINATION lib/swift$<$<NOT :$<BOOL :${BUILD_SHARED_LIBS} >>:_static>/${SWIFT_INSTALL_SUBDIR} )
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ if(NOT CMAKE_SYSTEM_NAME MATCHES "Darwin|Windows")
28
28
endif ()
29
29
30
30
set_target_properties (plutil PROPERTIES
31
- INSTALL_RPATH "$ORIGIN/../lib/swift/$<LOWER_CASE: ${CMAKE_SYSTEM_NAME} > " )
31
+ INSTALL_RPATH "$ORIGIN/../lib/swift/${SWIFT_INSTALL_SUBDIR} " )
32
32
33
33
34
34
set_property (GLOBAL APPEND PROPERTY Foundation_EXPORTS plutil)
Original file line number Diff line number Diff line change @@ -23,12 +23,8 @@ set_target_properties(uuid PROPERTIES
23
23
if (NOT BUILD_SHARED_LIBS )
24
24
set_property (GLOBAL APPEND PROPERTY Foundation_EXPORTS uuid)
25
25
26
- # get_swift_host_arch(swift_arch)
27
-
28
- # TODO(drexin): should be installed in architecture specific folder, once
29
- # the layout is fixed for non-Darwin platforms
30
26
install (TARGETS uuid
31
- ARCHIVE DESTINATION lib/swift_static/$<LOWER_CASE: ${CMAKE_SYSTEM_NAME} >
32
- LIBRARY DESTINATION lib/swift_static/$<LOWER_CASE: ${CMAKE_SYSTEM_NAME} >
27
+ ARCHIVE DESTINATION lib/swift_static/${SWIFT_INSTALL_SUBDIR}
28
+ LIBRARY DESTINATION lib/swift_static/${SWIFT_INSTALL_SUBDIR}
33
29
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} )
34
30
endif ()
Original file line number Diff line number Diff line change @@ -67,15 +67,19 @@ function(_install_target module)
67
67
set (swift swift)
68
68
endif ()
69
69
70
+ get_swift_host_arch(swift_arch)
71
+ set (install_subdir "${swift_os} " )
72
+ if (NOT CMAKE_SYSTEM_NAME MATCHES "Darwin|Windows" )
73
+ set (install_subdir "${install_subdir} /${swift_arch} " )
74
+ endif ()
70
75
install (TARGETS ${module}
71
- ARCHIVE DESTINATION lib/${swift} /${swift_os }
72
- LIBRARY DESTINATION lib/${swift} /${swift_os }
76
+ ARCHIVE DESTINATION lib/${swift} /${install_subdir }
77
+ LIBRARY DESTINATION lib/${swift} /${install_subdir }
73
78
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} )
74
79
if (type STREQUAL EXECUTABLE)
75
80
return ()
76
81
endif ()
77
82
78
- get_swift_host_arch(swift_arch)
79
83
get_target_property (module_name ${module} Swift_MODULE_NAME)
80
84
if (NOT module_name)
81
85
set (module_name ${module} )
You can’t perform that action at this time.
0 commit comments