File tree Expand file tree Collapse file tree 5 files changed +20
-14
lines changed Expand file tree Collapse file tree 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)
5959set (THREADS_PREFER_PTHREAD_FLAG OFF )
6060find_package (Threads REQUIRED)
6161
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+
6268set (SAVED_BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS} )
6369set (BUILD_SHARED_LIBS NO )
6470add_subdirectory (CoreFoundation EXCLUDE_FROM_ALL )
@@ -99,13 +105,13 @@ if(NOT BUILD_SHARED_LIBS)
99105 endif ()
100106
101107 install (TARGETS CoreFoundation CFXMLInterface
102- DESTINATION lib/swift_static/$<LOWER_CASE: ${CMAKE_SYSTEM_NAME} > )
108+ DESTINATION lib/swift_static/${SWIFT_INSTALL_SUBDIR} )
103109
104110 if (BUILD_NETWORKING)
105111 set_property (GLOBAL APPEND PROPERTY Foundation_EXPORTS
106112 CFURLSessionInterface)
107113 install (TARGETS CFURLSessionInterface
108- DESTINATION lib/swift_static/$<LOWER_CASE: ${CMAKE_SYSTEM_NAME} > )
114+ DESTINATION lib/swift_static/${SWIFT_INSTALL_SUBDIR} )
109115 endif ()
110116endif ()
111117
Original file line number Diff line number Diff line change @@ -11,5 +11,5 @@ set_target_properties(BlocksRuntime PROPERTIES
1111add_library (BlocksRuntime::BlocksRuntime ALIAS BlocksRuntime)
1212
1313install (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")
2828endif ()
2929
3030set_target_properties (plutil PROPERTIES
31- INSTALL_RPATH "$ORIGIN/../lib/swift/$<LOWER_CASE: ${CMAKE_SYSTEM_NAME} > " )
31+ INSTALL_RPATH "$ORIGIN/../lib/swift/${SWIFT_INSTALL_SUBDIR} " )
3232
3333
3434set_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
2323if (NOT BUILD_SHARED_LIBS )
2424 set_property (GLOBAL APPEND PROPERTY Foundation_EXPORTS uuid)
2525
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
3026 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}
3329 RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} )
3430endif ()
Original file line number Diff line number Diff line change @@ -67,15 +67,19 @@ function(_install_target module)
6767 set (swift swift)
6868 endif ()
6969
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 ()
7075 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 }
7378 RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} )
7479 if (type STREQUAL EXECUTABLE)
7580 return ()
7681 endif ()
7782
78- get_swift_host_arch(swift_arch)
7983 get_target_property (module_name ${module} Swift_MODULE_NAME)
8084 if (NOT module_name)
8185 set (module_name ${module} )
You can’t perform that action at this time.
0 commit comments