File tree Expand file tree Collapse file tree 5 files changed +16
-13
lines changed Expand file tree Collapse file tree 5 files changed +16
-13
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,14 @@ project(Foundation
1313 LANGUAGES C Swift)
1414enable_testing ()
1515
16+ if (NOT SWIFT_SYSTEM_NAME)
17+ if (CMAKE_SYSTEM_NAME STREQUAL Darwin)
18+ set (SWIFT_SYSTEM_NAME macosx)
19+ else ()
20+ set (SWIFT_SYSTEM_NAME "$<LOWER_CASE:${CMAKE_SYSTEM_NAME} >" )
21+ endif ()
22+ endif ()
23+
1624# NOTE(compnerd) default to /MD or /MDd by default based on the configuration.
1725# Cache the variable to allow the user to alter the configuration.
1826set (CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>DLL" CACHE
@@ -99,13 +107,13 @@ if(NOT BUILD_SHARED_LIBS)
99107 endif ()
100108
101109 install (TARGETS CoreFoundation CFXMLInterface
102- DESTINATION lib/swift_static/$<LOWER_CASE: ${CMAKE_SYSTEM_NAME} > )
110+ DESTINATION lib/swift_static/${SWIFT_SYSTEM_NAME} )
103111
104112 if (BUILD_NETWORKING)
105113 set_property (GLOBAL APPEND PROPERTY Foundation_EXPORTS
106114 CFURLSessionInterface)
107115 install (TARGETS CFURLSessionInterface
108- DESTINATION lib/swift_static/$<LOWER_CASE: ${CMAKE_SYSTEM_NAME} > )
116+ DESTINATION lib/swift_static/${SWIFT_SYSTEM_NAME} )
109117 endif ()
110118endif ()
111119
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_SYSTEM_NAME}
15+ LIBRARY DESTINATION lib/swift$<$<NOT :$<BOOL :${BUILD_SHARED_LIBS} >>:_static>/${SWIFT_SYSTEM_NAME} )
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_SYSTEM_NAME} " )
3232
3333
3434set_property (GLOBAL APPEND PROPERTY Foundation_EXPORTS plutil)
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ if(NOT BUILD_SHARED_LIBS)
2828 # TODO(drexin): should be installed in architecture specific folder, once
2929 # the layout is fixed for non-Darwin platforms
3030 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} >
31+ ARCHIVE DESTINATION lib/swift_static/${SWIFT_SYSTEM_NAME}
32+ LIBRARY DESTINATION lib/swift_static/${SWIFT_SYSTEM_NAME}
3333 RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} )
3434endif ()
Original file line number Diff line number Diff line change @@ -49,12 +49,7 @@ endfunction()
4949# Sets ${result_var_name} with the converted OS name derived from
5050# CMAKE_SYSTEM_NAME.
5151function (get_swift_host_os result_var_name)
52- if (CMAKE_SYSTEM_NAME STREQUAL Darwin)
53- set (${result_var_name} macosx PARENT_SCOPE)
54- else ()
55- string (TOLOWER ${CMAKE_SYSTEM_NAME} cmake_system_name_lc)
56- set (${result_var_name} ${cmake_system_name_lc} PARENT_SCOPE)
57- endif ()
52+ set (${result_var_name} ${SWIFT_SYSTEM_NAME} PARENT_SCOPE)
5853endfunction ()
5954
6055function (_install_target module)
You can’t perform that action at this time.
0 commit comments