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
8
8
#]]
9
9
10
10
cmake_minimum_required (VERSION 3.16.0)
11
- project (swift- system
11
+ project (SwiftSystem
12
12
LANGUAGES C Swift)
13
13
14
14
list (APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR} /cmake/modules)
@@ -21,9 +21,4 @@ set(CMAKE_Swift_MODULE_DIRECTORY ${CMAKE_BINARY_DIR}/swift)
21
21
include (SwiftSupport)
22
22
23
23
add_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
7
7
See https://swift.org/LICENSE.txt for license information
8
8
#]]
9
9
10
- add_library (System
10
+ add_library (SystemPackage
11
11
Errno.swift
12
12
FileDescriptor.swift
13
13
FileHelpers.swift
@@ -17,24 +17,26 @@ add_library(System
17
17
SystemString.swift
18
18
Util.swift
19
19
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
21
23
FilePath /FilePath .swift
22
24
FilePath /FilePathComponents.swift
23
25
FilePath /FilePathComponentView.swift
24
26
FilePath /FilePathParsing.swift
25
27
FilePath /FilePathString.swift
26
28
FilePath /FilePathSyntax.swift
27
29
FilePath /FilePathWindows.swift)
28
- target_sources (System PRIVATE
30
+ target_sources (SystemPackage PRIVATE
29
31
Internals/CInterop.swift
30
32
Internals/Constants.swift
31
33
Internals/Exports.swift
32
34
Internals/Mocking.swift
33
35
Internals/Syscalls.swift
34
36
Internals/WindowsSyscallAdapters.swift)
35
- target_link_libraries (System PRIVATE
37
+ target_link_libraries (SystemPackage PRIVATE
36
38
CSystem)
37
39
38
40
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
17
17
function (get_swift_host_arch result_var_name)
18
18
if ("${CMAKE_SYSTEM_PROCESSOR} " STREQUAL "x86_64" )
19
19
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 ()
22
26
elseif ("${CMAKE_SYSTEM_PROCESSOR} " STREQUAL "ppc64" )
23
27
set ("${result_var_name} " "powerpc64" PARENT_SCOPE)
24
28
elseif ("${CMAKE_SYSTEM_PROCESSOR} " STREQUAL "ppc64le" )
@@ -31,6 +35,8 @@ function(get_swift_host_arch result_var_name)
31
35
set ("${result_var_name} " "armv7" PARENT_SCOPE)
32
36
elseif ("${CMAKE_SYSTEM_PROCESSOR} " STREQUAL "armv7-a" )
33
37
set ("${result_var_name} " "armv7" PARENT_SCOPE)
38
+ elseif ("${CMAKE_SYSTEM_PROCESSOR} " STREQUAL "amd64" )
39
+ set ("${result_var_name} " "amd64" PARENT_SCOPE)
34
40
elseif ("${CMAKE_SYSTEM_PROCESSOR} " STREQUAL "AMD64" )
35
41
set ("${result_var_name} " "x86_64" PARENT_SCOPE)
36
42
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