Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: apple/swift-atomics
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 1.1.0
Choose a base ref
...
head repository: apple/swift-atomics
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 1.2.0
Choose a head ref

Commits on May 19, 2023

  1. Copy the full SHA
    a79829b View commit details
  2. Merge pull request #85 from lorentey/fix-code-signing

    [Xcode] Set a code sign identity
    lorentey authored May 19, 2023
    Copy the full SHA
    b32aa05 View commit details

Commits on Jun 20, 2023

  1. [Xcode] Don’t use a bridging header in a framework target

    Oops, that was not intended to work, and in fact it produces warnings in clients.
    
    Instead, change _sa_retain_n and _sa_release_n to Swift calling convention and call them using _silgen_name trickery when in single-module configuration.
    
    Resolves rdar://110860922
    lorentey committed Jun 20, 2023
    Copy the full SHA
    55a158b View commit details
  2. Merge pull request #87 from lorentey/fix-header-in-xcodeproj

    [Xcode] Don’t use a bridging header in a framework target
    lorentey authored Jun 20, 2023
    Copy the full SHA
    8bdc853 View commit details

Commits on Jul 6, 2023

  1. Update AtomicLazyReference.swift.gyb

    Fix reference doc variable references
    rolson authored Jul 6, 2023
    Copy the full SHA
    cbd73b1 View commit details

Commits on Jul 8, 2023

  1. [_AtomicsShims] Don’t define atomic operations when this header is co…

    …mpiled as C++
    
    `_Atomic(_sa_dword)` trips up C++. This is likely due to real issues, but it seems pointless to try to fix it — rather than heroically trying to keep this header working, we can simply force the use of native builtins on Swift 5.9 and later. (I planned to do that anyway, as a major step towards deleting `_AtomicsShims` altogether.)
    lorentey committed Jul 8, 2023
    Copy the full SHA
    15824c7 View commit details
  2. Copy the full SHA
    ae2e46a View commit details
  3. Copy the full SHA
    ca9d581 View commit details
  4. Update Xcode project configuration

    Switch from the classic `-parse-stdlib` option to the new `BuiltinModule` experimental feature.
    lorentey committed Jul 8, 2023
    Copy the full SHA
    9b97b05 View commit details
  5. Copy the full SHA
    1698b26 View commit details

Commits on Jul 10, 2023

  1. Merge pull request #89 from rolson/patch-1

    Fix reference doc variable references
    lorentey authored Jul 10, 2023
    Copy the full SHA
    6d3d340 View commit details
  2. Merge pull request #90 from lorentey/fix-c++-interop

    Avoid C atomic operations in Swift 5.9+
    lorentey authored Jul 10, 2023
    Copy the full SHA
    1c2c004 View commit details
  3. Regenerate sources

    lorentey committed Jul 10, 2023
    Copy the full SHA
    4138292 View commit details
  4. Merge pull request #91 from lorentey/regenerate-sources

    Regenerate sources
    lorentey authored Jul 10, 2023
    Copy the full SHA
    b37e0a6 View commit details

Commits on Jul 18, 2023

  1. Copy the full SHA
    5f7709d View commit details

Commits on Jul 19, 2023

  1. Merge pull request #93 from lorentey/fix-old-manifests

    Fix version-specific manifest for 5.6..<5.9
    lorentey authored Jul 19, 2023
    Copy the full SHA
    2ff28f8 View commit details

Commits on Aug 11, 2023

  1. [_AtomicShims] On Darwin, ensure we link against libswiftCore using a…

    …ssembly shenanigans
    
    This avoids a linker failure when the build system decides to build this module as a standalone library.
    
    Hopefully this will all go away soon, when swift_retain_n/swift_release_n will become primitives exposed by the stdlib.
    lorentey committed Aug 11, 2023
    Copy the full SHA
    673864b View commit details

Commits on Aug 14, 2023

  1. [_AtomicShims] Don’t try to extend the library path using .linker_option

    This emits a warning and it seems to be unnecessary.
    lorentey committed Aug 14, 2023
    Copy the full SHA
    5603f61 View commit details

Commits on Aug 15, 2023

  1. Merge pull request #97 from lorentey/autolink-libswiftCore

    [_AtomicShims] On Darwin, ensure we link against libswiftCore using assembly shenanigans
    lorentey authored Aug 15, 2023
    Copy the full SHA
    38a8ccd View commit details

Commits on Sep 14, 2023

  1. Avoid using symlinks for package files

    Resolves #98
    ktoso committed Sep 14, 2023
    Copy the full SHA
    b6c32c1 View commit details
  2. Copy the full SHA
    b47c8b1 View commit details

Commits on Sep 18, 2023

  1. Copy the full SHA
    d75ef1b View commit details
  2. Copy the full SHA
    1f6a86f View commit details

Commits on Sep 21, 2023

  1. Copy the full SHA
    c39a7ef View commit details
  2. Reorganize source folder

    lorentey committed Sep 21, 2023
    Copy the full SHA
    b1b74cb View commit details
  3. Copy the full SHA
    4166cff View commit details
  4. Copy the full SHA
    9db6c56 View commit details
  5. DoubleWord.AtomicRepresentation: Use DoubleWord storage on all pl…

    …atforms
    
    We used to use Int64 on 32-bit architectures, but the inconsistency is bothering me. (Even ignoring alignment issues on SysV-derived ABIs on i386.)
    lorentey committed Sep 21, 2023
    Copy the full SHA
    9351ce0 View commit details

Commits on Sep 22, 2023

  1. Merge pull request #101 from lorentey/reorg

    Reorganize sources for future work
    lorentey authored Sep 22, 2023
    Copy the full SHA
    bb83f84 View commit details
  2. [native atomics] Fix alignment issues by reintroducing custom storage…

    … types
    
    The SysV ABI defined uint64_t with 4 byte alignment on i386 — so we can’t just assume that the integer types will have the right alignment by default for atomics.
    
    Emulate the original `_Atomic<Width>Storage` types in the C shims even in native atomics configuration, so that they can carry a custom `@_alignment` attribute.
    lorentey committed Sep 22, 2023
    Copy the full SHA
    8b703fe View commit details
  3. Copy the full SHA
    8dd81ae View commit details
  4. Copy the full SHA
    a9219a8 View commit details
  5. Copy the full SHA
    f10f031 View commit details
  6. Merge pull request #102 from lorentey/fix-alignment-issues

    Fix alignment issues with double-wide atomics on i386
    lorentey authored Sep 22, 2023
    Copy the full SHA
    8e18576 View commit details
  7. Drop support for Swift 5.6

    Clients who cannot upgrade their toolchain yet will continue to work with Swift Atomics 1.1.
    
    List of currently supported Swift releases:
    
    - Swift 5.9 release series
    - Swift 5.8 release series
    - Swift 5.7 release series
    
    We also aim to support building and using swift-atomics on developer snapshots of Swift’s active branches (release/5.10 and main).
    lorentey committed Sep 22, 2023
    Copy the full SHA
    8be2ba9 View commit details
  8. Copy the full SHA
    6ed54fa View commit details
  9. Merge pull request #105 from lorentey/update-cmake

    [CMake] Do not list .gyb files as sources
    lorentey authored Sep 22, 2023
    Copy the full SHA
    8650506 View commit details
  10. Merge pull request #103 from lorentey/drop-swift-5.6

    Drop support for Swift 5.6
    lorentey authored Sep 22, 2023
    Copy the full SHA
    d8a5239 View commit details
  11. Copy the full SHA
    de979cd View commit details
  12. Copy the full SHA
    4a34c7a View commit details
  13. Update README

    lorentey committed Sep 22, 2023
    Copy the full SHA
    5b1941e View commit details
  14. Copy the full SHA
    1abcb95 View commit details

Commits on Sep 23, 2023

  1. Copy the full SHA
    8189a83 View commit details

Commits on Sep 26, 2023

  1. Copy the full SHA
    d976dd2 View commit details
  2. Let builtins & shims expose different primitive signatures

    For builtins, we want to emulate the stdlib’s solution where all atomic primitive operations take and return a (sort of) opaque atomic representation value.
    
    For C shims, we do not want to atomic primitives to take and return _Atomic(T) values, so let’s revert to the original 1.1.x solution.
    lorentey committed Sep 26, 2023
    Copy the full SHA
    48fad5a View commit details

Commits on Sep 27, 2023

  1. Avoid confusing Swift 5.7 with _pointerBitWidth conditionals

    #if conditional parsing is evidently broken in 5.7, and it gets confused unless things are arranged just right. Things seem to work as long as the `compiler(>=5.9)` conditional is put on its own `#if` construct on the topmost level — so let’s do that for now.
    lorentey committed Sep 27, 2023
    Copy the full SHA
    fe0fc8b View commit details
  2. On 5.9, hide the _AtomicsShims import from the public interface

    This appears to resolve a build failure when library evolution is enabled. (This isn’t a fully supported configuration (this package is not ABI stable), but it should still be possible to build the package in that configuration.)
    
    @_implementationOnly has bad failure modes when library evolution isn’t enabled, but I hope we’ll be avoiding those here, as on 5.9+, we’re only using it to import a couple of functions — we aren’t relying on imported things to set struct layouts or anything like that. 🤞
    lorentey committed Sep 27, 2023
    Copy the full SHA
    f26da16 View commit details
  3. [Xcode] Move code sign config to shared xcconfig

    This makes these settings automatically apply to the test target, too.
    lorentey committed Sep 27, 2023
    Copy the full SHA
    084814f View commit details
  4. [Xcode] Formally update .xcodeproj to Xcode 15

    Also, remove an orphaned package manifest link.
    lorentey committed Sep 27, 2023
    Copy the full SHA
    02d0d97 View commit details
  5. Fix CMake configuration

    lorentey committed Sep 27, 2023
    Copy the full SHA
    3431b85 View commit details
Showing with 11,190 additions and 10,630 deletions.
  1. +12 −0 CMakeLists.txt
  2. +17 −23 Package.swift
  3. +87 −0 Package@swift-5.7.swift
  4. +87 −0 Package@swift-5.8.swift
  5. +69 −40 README.md
  6. +1 −1 Sources/Atomics/Atomics.docc/Extensions/AtomicRawRepresentableStorage.md
  7. +2 −1 Sources/Atomics/Atomics.docc/Extensions/AtomicStorage.md
  8. +1 −0 Sources/Atomics/Atomics.docc/Extensions/ManagedAtomic.md
  9. +1 −0 Sources/Atomics/Atomics.docc/Extensions/UnsafeAtomic.md
  10. +24 −16 Sources/Atomics/CMakeLists.txt
  11. +55 −31 Sources/Atomics/{ → Conformances}/AtomicBool.swift.gyb
  12. +70 −66 Sources/Atomics/{ → Conformances}/IntegerConformances.swift.gyb
  13. +0 −4 Sources/Atomics/{AtomicOptionalRawRepresentable.swift → Conformances/OptionalRawRepresentable.swift}
  14. +69 −29 Sources/Atomics/{ → Conformances}/PointerConformances.swift.gyb
  15. +0 −4 Sources/Atomics/{AtomicRawRepresentable.swift → Conformances/RawRepresentable.swift}
  16. +64 −35 Sources/Atomics/{ → Conformances}/autogenerated/AtomicBool.swift
  17. +595 −536 Sources/Atomics/{ → Conformances}/autogenerated/IntegerConformances.swift
  18. +234 −118 Sources/Atomics/{ → Conformances}/autogenerated/PointerConformances.swift
  19. +50 −74 Sources/Atomics/{ → Primitives}/Primitives.native.swift.gyb
  20. +25 −25 Sources/Atomics/{ → Primitives}/Primitives.shims.swift.gyb
  21. +609 −1,961 Sources/Atomics/{ → Primitives}/autogenerated/Primitives.native.swift
  22. 0 Sources/Atomics/{ → Primitives}/autogenerated/Primitives.shims.swift
  23. +0 −4 Sources/Atomics/{ → Protocols}/AtomicInteger.swift
  24. +0 −4 Sources/Atomics/{AtomicOptional.swift → Protocols/AtomicOptionalWrappable.swift}
  25. +1 −3 Sources/Atomics/{AtomicStrongReference.swift → Protocols/AtomicReference.swift}
  26. +0 −12 Sources/Atomics/{AtomicValue.swift → Protocols/AtomicStorage.swift}
  27. +19 −0 Sources/Atomics/Protocols/AtomicValue.swift
  28. +0 −4 Sources/Atomics/{ → Types}/AtomicMemoryOrderings.swift
  29. +65 −3 Sources/Atomics/{ → Types}/DoubleWord.swift
  30. +111 −0 Sources/Atomics/Types/IntegerOperations.swift.gyb
  31. +266 −0 Sources/Atomics/Types/ManagedAtomic.swift
  32. +103 −0 Sources/Atomics/Types/ManagedAtomicLazyReference.swift
  33. +5 −148 Sources/Atomics/{HighLevelTypes.swift.gyb → Types/UnsafeAtomic.swift}
  34. +8 −58 Sources/Atomics/{AtomicLazyReference.swift.gyb → Types/UnsafeAtomicLazyReference.swift}
  35. +497 −0 Sources/Atomics/Types/autogenerated/IntegerOperations.swift
  36. +9 −4 Sources/Atomics/Unmanaged extensions.swift
  37. +0 −272 Sources/Atomics/autogenerated/AtomicLazyReference.swift
  38. +0 −1,020 Sources/Atomics/autogenerated/HighLevelTypes.swift
  39. +3 −0 Sources/_AtomicsShims/CMakeLists.txt
  40. +12 −5 Sources/_AtomicsShims/include/_AtomicsShims.h
  41. +7 −0 Sources/_AtomicsShims/src/_AtomicsShims.c
  42. +106 −17 Tests/AtomicsTests/Basics/BasicTests.gyb-template
  43. +297 −230 Tests/AtomicsTests/Basics/autogenerated/BasicAtomicBoolTests.swift
  44. +297 −230 Tests/AtomicsTests/Basics/autogenerated/BasicAtomicDoubleWordTests.swift
  45. +297 −230 Tests/AtomicsTests/Basics/autogenerated/BasicAtomicInt16Tests.swift
  46. +297 −230 Tests/AtomicsTests/Basics/autogenerated/BasicAtomicInt32Tests.swift
  47. +297 −230 Tests/AtomicsTests/Basics/autogenerated/BasicAtomicInt64Tests.swift
  48. +297 −230 Tests/AtomicsTests/Basics/autogenerated/BasicAtomicInt8Tests.swift
  49. +297 −230 Tests/AtomicsTests/Basics/autogenerated/BasicAtomicIntTests.swift
  50. +297 −230 Tests/AtomicsTests/Basics/autogenerated/BasicAtomicMutablePointerTests.swift
  51. +297 −230 Tests/AtomicsTests/Basics/autogenerated/BasicAtomicMutableRawPointerTests.swift
  52. +297 −230 Tests/AtomicsTests/Basics/autogenerated/BasicAtomicOptionalMutablePointerTests.swift
  53. +297 −230 Tests/AtomicsTests/Basics/autogenerated/BasicAtomicOptionalMutableRawPointerTests.swift
  54. +297 −230 Tests/AtomicsTests/Basics/autogenerated/BasicAtomicOptionalPointerTests.swift
  55. +297 −230 Tests/AtomicsTests/Basics/autogenerated/BasicAtomicOptionalRawPointerTests.swift
  56. +297 −230 Tests/AtomicsTests/Basics/autogenerated/BasicAtomicOptionalRawRepresentableTests.swift
  57. +297 −230 Tests/AtomicsTests/Basics/autogenerated/BasicAtomicOptionalReferenceTests.swift
  58. +297 −230 Tests/AtomicsTests/Basics/autogenerated/BasicAtomicOptionalUnmanagedTests.swift
  59. +297 −230 Tests/AtomicsTests/Basics/autogenerated/BasicAtomicPointerTests.swift
  60. +297 −230 Tests/AtomicsTests/Basics/autogenerated/BasicAtomicRawPointerTests.swift
  61. +297 −230 Tests/AtomicsTests/Basics/autogenerated/BasicAtomicRawRepresentableTests.swift
  62. +297 −230 Tests/AtomicsTests/Basics/autogenerated/BasicAtomicReferenceTests.swift
  63. +297 −230 Tests/AtomicsTests/Basics/autogenerated/BasicAtomicUInt16Tests.swift
  64. +297 −230 Tests/AtomicsTests/Basics/autogenerated/BasicAtomicUInt32Tests.swift
  65. +297 −230 Tests/AtomicsTests/Basics/autogenerated/BasicAtomicUInt64Tests.swift
  66. +297 −230 Tests/AtomicsTests/Basics/autogenerated/BasicAtomicUInt8Tests.swift
  67. +297 −230 Tests/AtomicsTests/Basics/autogenerated/BasicAtomicUIntTests.swift
  68. +297 −230 Tests/AtomicsTests/Basics/autogenerated/BasicAtomicUnmanagedTests.swift
  69. +18 −29 Utilities/gyb_utils.py
  70. +1 −1 Utilities/run-full-tests.sh
  71. +1 −9 Xcode/Atomics.xcconfig
  72. +152 −85 Xcode/Atomics.xcodeproj/project.pbxproj
  73. +1 −1 Xcode/Atomics.xcodeproj/xcshareddata/xcschemes/Atomics.xcscheme
  74. +0 −7 Xcode/AtomicsTests.xcconfig
  75. +11 −0 Xcode/Shared.xcconfig
12 changes: 12 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -25,6 +25,18 @@ endif()
include(CTest)
include(SwiftSupport)

set(ATOMICS_SWIFT_FLAGS)
set(ATOMICS_C_FLAGS)

if(CMAKE_Swift_COMPILER_VERSION VERSION_GREATER_EQUAL 5.9)
list(APPEND ATOMICS_SWIFT_FLAGS
"-enable-experimental-feature BuiltinModule"
"-DATOMICS_NATIVE_BUILTINS"
"-Xcc" "-DATOMICS_NATIVE_BUILTINS=1")
list(APPEND ATOMICS_C_FLAGS
"-DATOMICS_NATIVE_BUILTINS=1")
endif()

add_subdirectory(Sources)
if(BUILD_TESTING)
add_subdirectory(Tests)
40 changes: 17 additions & 23 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version:5.6
// swift-tools-version:5.9
//===----------------------------------------------------------------------===//
//
// This source file is part of the Swift.org open source project
@@ -13,23 +13,17 @@

import PackageDescription

// Enables the use of native Swift compiler builtins instead of C atomics.
// This requires the use of an unsafe compiler flag, so it cannot currently
// be enabled when this package is built as a regular SwiftPM dependency.
let useNativeBuiltins = false

var _cSettings: [CSetting] = []
var _swiftSettings: [SwiftSetting] = []

if useNativeBuiltins {
_cSettings += [
.define("ATOMICS_NATIVE_BUILTINS"),
]
_swiftSettings += [
.define("ATOMICS_NATIVE_BUILTINS"),
.unsafeFlags(["-Xfrontend", "-parse-stdlib"]),
]
}
// Enable the use of native Swift compiler builtins instead of C atomics.
_cSettings += [
.define("ATOMICS_NATIVE_BUILTINS"),
]
_swiftSettings += [
.define("ATOMICS_NATIVE_BUILTINS"),
.enableExperimentalFeature("BuiltinModule")
]

let package = Package(
name: "swift-atomics",
@@ -50,13 +44,12 @@ let package = Package(
dependencies: ["_AtomicsShims"],
exclude: [
"CMakeLists.txt",
"AtomicBool.swift.gyb",
"AtomicLazyReference.swift.gyb",
"HighLevelTypes.swift.gyb",
"IntegerConformances.swift.gyb",
"PointerConformances.swift.gyb",
"Primitives.native.swift.gyb",
"Primitives.shims.swift.gyb",
"Conformances/AtomicBool.swift.gyb",
"Conformances/IntegerConformances.swift.gyb",
"Conformances/PointerConformances.swift.gyb",
"Primitives/Primitives.native.swift.gyb",
"Primitives/Primitives.shims.swift.gyb",
"Types/IntegerOperations.swift.gyb",
],
cSettings: _cSettings,
swiftSettings: _swiftSettings
@@ -93,7 +86,8 @@ let package = Package(
"Basics/BasicAtomicUInt8Tests.swift.gyb",
"Basics/BasicAtomicUIntTests.swift.gyb",
"Basics/BasicAtomicUnmanagedTests.swift.gyb",
]
],
swiftSettings: _swiftSettings
),
]
)
87 changes: 87 additions & 0 deletions Package@swift-5.7.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
// swift-tools-version:5.7
//===----------------------------------------------------------------------===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2020 - 2023 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/LICENSE.txt for license information
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//

import PackageDescription

var _cSettings: [CSetting] = []
var _swiftSettings: [SwiftSetting] = []

// Note: ATOMICS_NATIVE_BUILTINS works via the BuiltinModule language feature,
// so it is not usable in language versions below 5.9.

let package = Package(
name: "swift-atomics",
products: [
.library(
name: "Atomics",
targets: ["Atomics"]),
],
targets: [
.target(
name: "_AtomicsShims",
exclude: [
"CMakeLists.txt"
]
),
.target(
name: "Atomics",
dependencies: ["_AtomicsShims"],
exclude: [
"CMakeLists.txt",
"Conformances/AtomicBool.swift.gyb",
"Conformances/IntegerConformances.swift.gyb",
"Conformances/PointerConformances.swift.gyb",
"Primitives/Primitives.native.swift.gyb",
"Primitives/Primitives.shims.swift.gyb",
"Types/IntegerOperations.swift.gyb",
],
cSettings: _cSettings,
swiftSettings: _swiftSettings
),
.testTarget(
name: "AtomicsTests",
dependencies: ["Atomics"],
exclude: [
"main.swift",
"Basics/BasicTests.gyb-template",
"Basics/BasicAtomicBoolTests.swift.gyb",
"Basics/BasicAtomicDoubleWordTests.swift.gyb",
"Basics/BasicAtomicInt16Tests.swift.gyb",
"Basics/BasicAtomicInt32Tests.swift.gyb",
"Basics/BasicAtomicInt64Tests.swift.gyb",
"Basics/BasicAtomicInt8Tests.swift.gyb",
"Basics/BasicAtomicIntTests.swift.gyb",
"Basics/BasicAtomicMutablePointerTests.swift.gyb",
"Basics/BasicAtomicMutableRawPointerTests.swift.gyb",
"Basics/BasicAtomicOptionalMutablePointerTests.swift.gyb",
"Basics/BasicAtomicOptionalMutableRawPointerTests.swift.gyb",
"Basics/BasicAtomicOptionalPointerTests.swift.gyb",
"Basics/BasicAtomicOptionalRawPointerTests.swift.gyb",
"Basics/BasicAtomicOptionalRawRepresentableTests.swift.gyb",
"Basics/BasicAtomicOptionalReferenceTests.swift.gyb",
"Basics/BasicAtomicOptionalUnmanagedTests.swift.gyb",
"Basics/BasicAtomicPointerTests.swift.gyb",
"Basics/BasicAtomicRawPointerTests.swift.gyb",
"Basics/BasicAtomicRawRepresentableTests.swift.gyb",
"Basics/BasicAtomicReferenceTests.swift.gyb",
"Basics/BasicAtomicUInt16Tests.swift.gyb",
"Basics/BasicAtomicUInt32Tests.swift.gyb",
"Basics/BasicAtomicUInt64Tests.swift.gyb",
"Basics/BasicAtomicUInt8Tests.swift.gyb",
"Basics/BasicAtomicUIntTests.swift.gyb",
"Basics/BasicAtomicUnmanagedTests.swift.gyb",
],
swiftSettings: _swiftSettings
),
]
)
87 changes: 87 additions & 0 deletions Package@swift-5.8.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
// swift-tools-version:5.7
//===----------------------------------------------------------------------===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2020 - 2023 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/LICENSE.txt for license information
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//

import PackageDescription

var _cSettings: [CSetting] = []
var _swiftSettings: [SwiftSetting] = []

// Note: ATOMICS_NATIVE_BUILTINS works via the BuiltinModule language feature,
// so it is not usable in language versions below 5.9.

let package = Package(
name: "swift-atomics",
products: [
.library(
name: "Atomics",
targets: ["Atomics"]),
],
targets: [
.target(
name: "_AtomicsShims",
exclude: [
"CMakeLists.txt"
]
),
.target(
name: "Atomics",
dependencies: ["_AtomicsShims"],
exclude: [
"CMakeLists.txt",
"Conformances/AtomicBool.swift.gyb",
"Conformances/IntegerConformances.swift.gyb",
"Conformances/PointerConformances.swift.gyb",
"Primitives/Primitives.native.swift.gyb",
"Primitives/Primitives.shims.swift.gyb",
"Types/IntegerOperations.swift.gyb",
],
cSettings: _cSettings,
swiftSettings: _swiftSettings
),
.testTarget(
name: "AtomicsTests",
dependencies: ["Atomics"],
exclude: [
"main.swift",
"Basics/BasicTests.gyb-template",
"Basics/BasicAtomicBoolTests.swift.gyb",
"Basics/BasicAtomicDoubleWordTests.swift.gyb",
"Basics/BasicAtomicInt16Tests.swift.gyb",
"Basics/BasicAtomicInt32Tests.swift.gyb",
"Basics/BasicAtomicInt64Tests.swift.gyb",
"Basics/BasicAtomicInt8Tests.swift.gyb",
"Basics/BasicAtomicIntTests.swift.gyb",
"Basics/BasicAtomicMutablePointerTests.swift.gyb",
"Basics/BasicAtomicMutableRawPointerTests.swift.gyb",
"Basics/BasicAtomicOptionalMutablePointerTests.swift.gyb",
"Basics/BasicAtomicOptionalMutableRawPointerTests.swift.gyb",
"Basics/BasicAtomicOptionalPointerTests.swift.gyb",
"Basics/BasicAtomicOptionalRawPointerTests.swift.gyb",
"Basics/BasicAtomicOptionalRawRepresentableTests.swift.gyb",
"Basics/BasicAtomicOptionalReferenceTests.swift.gyb",
"Basics/BasicAtomicOptionalUnmanagedTests.swift.gyb",
"Basics/BasicAtomicPointerTests.swift.gyb",
"Basics/BasicAtomicRawPointerTests.swift.gyb",
"Basics/BasicAtomicRawRepresentableTests.swift.gyb",
"Basics/BasicAtomicReferenceTests.swift.gyb",
"Basics/BasicAtomicUInt16Tests.swift.gyb",
"Basics/BasicAtomicUInt32Tests.swift.gyb",
"Basics/BasicAtomicUInt64Tests.swift.gyb",
"Basics/BasicAtomicUInt8Tests.swift.gyb",
"Basics/BasicAtomicUIntTests.swift.gyb",
"Basics/BasicAtomicUnmanagedTests.swift.gyb",
],
swiftSettings: _swiftSettings
),
]
)
Loading