diff --git a/.gitignore b/.gitignore index 2c0658b..51ae994 100644 --- a/.gitignore +++ b/.gitignore @@ -2,7 +2,8 @@ /.swiftpm /.build /Packages -swift-system.xcodeproj +/*.xcodeproj xcuserdata/ .*.sw? +/.swiftpm .docc-build diff --git a/Package.swift b/Package.swift index 4a3c2c4..857c502 100644 --- a/Package.swift +++ b/Package.swift @@ -1,10 +1,9 @@ -// swift-tools-version:5.6 -// The swift-tools-version declares the minimum version of Swift required to build this package. +// swift-tools-version:5.8 /* This source file is part of the Swift System open source project - Copyright (c) 2020 Apple Inc. and the Swift System project authors + Copyright (c) 2020-2024 Apple Inc. and the Swift System project authors Licensed under Apache License v2.0 with Runtime Library Exception See https://swift.org/LICENSE.txt for license information @@ -47,6 +46,6 @@ let package = Package( swiftSettings: [ .define("SYSTEM_PACKAGE"), .define("SYSTEM_PACKAGE_DARWIN", .when(platforms: DarwinPlatforms)), - ]) + ]), ] ) diff --git a/README.md b/README.md index 14edea0..b5b5535 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ To use the `SystemPackage` library in a SwiftPM project, add the following line to the dependencies in your `Package.swift` file: ```swift -.package(url: "https://github.com/apple/swift-system", from: "1.0.0"), +.package(url: "https://github.com/apple/swift-system", from: "1.3.0"), ``` Finally, include `"SystemPackage"` as a dependency for your executable target: @@ -39,7 +39,7 @@ Finally, include `"SystemPackage"` as a dependency for your executable target: let package = Package( // name, platforms, products, etc. dependencies: [ - .package(url: "https://github.com/apple/swift-system", from: "1.0.0"), + .package(url: "https://github.com/apple/swift-system", from: "1.3.0"), // other dependencies ], targets: [ diff --git a/Sources/System/CMakeLists.txt b/Sources/System/CMakeLists.txt index f7c038b..1f3420a 100644 --- a/Sources/System/CMakeLists.txt +++ b/Sources/System/CMakeLists.txt @@ -41,6 +41,10 @@ target_sources(SystemPackage PRIVATE target_link_libraries(SystemPackage PUBLIC CSystem) +set(SWIFT_SYSTEM_APPLE_PLATFORMS "Darwin" "iOS" "watchOS" "tvOS" "visionOS") +if(CMAKE_SYSTEM_NAME IN_LIST SWIFT_SYSTEM_APPLE_PLATFORMS) + target_compile_definitions(SystemPackage PRIVATE SYSTEM_PACKAGE_DARWIN) +endif() _install_target(SystemPackage) set_property(GLOBAL APPEND PROPERTY SWIFT_SYSTEM_EXPORTS SystemPackage)