File tree Expand file tree Collapse file tree 5 files changed +49
-15
lines changed Expand file tree Collapse file tree 5 files changed +49
-15
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ See https://swift.org/LICENSE.txt for license information
88#]]
99
1010cmake_minimum_required (VERSION 3.16.0)
11- project (swift- system
11+ project (SwiftSystem
1212 LANGUAGES C Swift)
1313
1414list (APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR} /cmake/modules)
@@ -21,9 +21,4 @@ set(CMAKE_Swift_MODULE_DIRECTORY ${CMAKE_BINARY_DIR}/swift)
2121include (SwiftSupport)
2222
2323add_subdirectory (Sources )
24-
25- get_property (SWIFT_SYSTEM_EXPORTS GLOBAL PROPERTY SWIFT_SYSTEM_EXPORTS)
26- export (TARGETS ${SWIFT_SYSTEM_EXPORTS}
27- NAMESPACE SwiftSystem::
28- FILE swift-system -config.cmake
29- EXPORT_LINK_INTERFACE_LIBRARIES)
24+ add_subdirectory (cmake/modules)
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ Licensed under Apache License v2.0 with Runtime Library Exception
77See https://swift.org/LICENSE.txt for license information
88#]]
99
10- add_library (System
10+ add_library (SystemPackage
1111 Errno.swift
1212 FileDescriptor.swift
1313 FileHelpers.swift
@@ -17,24 +17,26 @@ add_library(System
1717 SystemString.swift
1818 Util.swift
1919 UtilConsumers.swift)
20- target_sources (System PRIVATE
20+ set_target_properties (SystemPackage PROPERTIES
21+ INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_Swift_MODULE_DIRECTORY} )
22+ target_sources (SystemPackage PRIVATE
2123 FilePath /FilePath .swift
2224 FilePath /FilePathComponents.swift
2325 FilePath /FilePathComponentView.swift
2426 FilePath /FilePathParsing.swift
2527 FilePath /FilePathString.swift
2628 FilePath /FilePathSyntax.swift
2729 FilePath /FilePathWindows.swift)
28- target_sources (System PRIVATE
30+ target_sources (SystemPackage PRIVATE
2931 Internals/CInterop.swift
3032 Internals/Constants.swift
3133 Internals/Exports.swift
3234 Internals/Mocking.swift
3335 Internals/Syscalls.swift
3436 Internals/WindowsSyscallAdapters.swift)
35- target_link_libraries (System PRIVATE
37+ target_link_libraries (SystemPackage PRIVATE
3638 CSystem)
3739
3840
39- _install_target(System )
40- set_property (GLOBAL APPEND PROPERTY SWIFT_SYSTEM_EXPORTS System )
41+ _install_target(SystemPackage )
42+ set_property (GLOBAL APPEND PROPERTY SWIFT_SYSTEM_EXPORTS SystemPackage )
Original file line number Diff line number Diff line change 1+ #[[
2+ This source file is part of the Swift System open source Project
3+
4+ Copyright (c) 2021 Apple Inc. and the Swift System project authors
5+ Licensed under Apache License v2.0 with Runtime Library Exception
6+
7+ See https://swift.org/LICENSE.txt for license information
8+ #]]
9+
10+ set (SWIFT_SYSTEM_EXPORTS_FILE ${CMAKE_CURRENT_BINARY_DIR} /SwiftSystemExports.cmake)
11+
12+ configure_file (SwiftSystemConfig.cmake.in
13+ ${CMAKE_CURRENT_BINARY_DIR} /SwiftSystemConfig.cmake)
14+
15+ get_property (SWIFT_SYSTEM_EXPORTS GLOBAL PROPERTY SWIFT_SYSTEM_EXPORTS)
16+ export (TARGETS ${SWIFT_SYSTEM_EXPORTS}
17+ NAMESPACE SwiftSystem::
18+ FILE ${SWIFT_SYSTEM_EXPORTS_FILE}
19+ EXPORT_LINK_INTERFACE_LIBRARIES)
Original file line number Diff line number Diff line change @@ -17,8 +17,12 @@ See https://swift.org/LICENSE.txt for license information
1717function (get_swift_host_arch result_var_name)
1818 if ("${CMAKE_SYSTEM_PROCESSOR} " STREQUAL "x86_64" )
1919 set ("${result_var_name} " "x86_64" PARENT_SCOPE)
20- elseif ("${CMAKE_SYSTEM_PROCESSOR} " STREQUAL "aarch64" )
21- set ("${result_var_name} " "aarch64" PARENT_SCOPE)
20+ elseif ("${CMAKE_SYSTEM_PROCESSOR} " MATCHES "AArch64|aarch64|arm64" )
21+ if (CMAKE_SYSTEM_NAME MATCHES Darwin)
22+ set ("${result_var_name} " "arm64" PARENT_SCOPE)
23+ else ()
24+ set ("${result_var_name} " "aarch64" PARENT_SCOPE)
25+ endif ()
2226 elseif ("${CMAKE_SYSTEM_PROCESSOR} " STREQUAL "ppc64" )
2327 set ("${result_var_name} " "powerpc64" PARENT_SCOPE)
2428 elseif ("${CMAKE_SYSTEM_PROCESSOR} " STREQUAL "ppc64le" )
@@ -31,6 +35,8 @@ function(get_swift_host_arch result_var_name)
3135 set ("${result_var_name} " "armv7" PARENT_SCOPE)
3236 elseif ("${CMAKE_SYSTEM_PROCESSOR} " STREQUAL "armv7-a" )
3337 set ("${result_var_name} " "armv7" PARENT_SCOPE)
38+ elseif ("${CMAKE_SYSTEM_PROCESSOR} " STREQUAL "amd64" )
39+ set ("${result_var_name} " "amd64" PARENT_SCOPE)
3440 elseif ("${CMAKE_SYSTEM_PROCESSOR} " STREQUAL "AMD64" )
3541 set ("${result_var_name} " "x86_64" PARENT_SCOPE)
3642 elseif ("${CMAKE_SYSTEM_PROCESSOR} " STREQUAL "IA64" )
Original file line number Diff line number Diff line change 1+ #[[
2+ This source file is part of the Swift System open source Project
3+
4+ Copyright (c) 2021 Apple Inc. and the Swift System project authors
5+ Licensed under Apache License v2.0 with Runtime Library Exception
6+
7+ See https://swift.org/LICENSE.txt for license information
8+ #]]
9+
10+ if (NOT TARGET SystemPackage)
11+ include (@SWIFT_SYSTEM_EXPORTS_FILE@)
12+ endif ()
You can’t perform that action at this time.
0 commit comments