Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/compatibility_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ jobs:
OPENGRAPHICS_BUILD_FOR_DARWIN_PLATFORM: 1
OPENGRAPHICS_WERROR: 1
OPENGRAPHICS_COREGRAPHICS: 1
OPENGRAPHICS_LIBRARY_EVOLUTION: 0
GH_TOKEN: ${{ github.token }}
steps:
- uses: actions/checkout@v4
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ jobs:
OPENGRAPHICS_BUILD_FOR_DARWIN_PLATFORM: 1
OPENGRAPHICS_WERROR: 1
OPENGRAPHICS_COREGRAPHICS: 0
OPENGRAPHICS_LIBRARY_EVOLUTION: 0
GH_TOKEN: ${{ github.token }}
steps:
- uses: actions/checkout@v4
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ jobs:
OPENGRAPHICS_BUILD_FOR_DARWIN_PLATFORM: 0
OPENGRAPHICS_WERROR: 1
OPENGRAPHICS_COREGRAPHICS: 0
OPENGRAPHICS_LIBRARY_EVOLUTION: 0
container: swift:${{ matrix.swift_version }}-jammy
steps:
- uses: actions/checkout@v4
Expand Down
16 changes: 16 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,21 +31,37 @@ let isXcodeEnv = Context.environment["__CFBundleIdentifier"] == "com.apple.dt.Xc

let development = envEnable("OPENGRAPHICS_DEVELOPMENT")

// MARK: - [env] OPENGRAPHICS_COREGRAPHICS

let coreGraphicsCondition = envEnable("OPENGRAPHICS_COREGRAPHICS", default: buildForDarwinPlatform)
if coreGraphicsCondition {
sharedSwiftSettings.append(.define("OPENGRAPHICS_COREGRAPHICS"))
}

// MARK: - [env] OPENGRAPHICS_WERROR

let warningsAsErrorsCondition = envEnable("OPENGRAPHICS_WERROR", default: isXcodeEnv && development)
if warningsAsErrorsCondition {
sharedSwiftSettings.append(.unsafeFlags(["-warnings-as-errors"]))
}

// MARK: - [env] OPENGRAPHICS_LIBRARY_EVOLUTION

let libraryEvolutionCondition = envEnable("OPENGRAPHICS_LIBRARY_EVOLUTION", default: buildForDarwinPlatform)

if libraryEvolutionCondition {
// NOTE: -enable-library-evolution will cause module verify failure for `swift build`.
// Either set OPENGRAPHICS_LIBRARY_EVOLUTION=0 or add `-Xswiftc -no-verify-emitted-module-interface` after `swift build`
sharedSwiftSettings.append(.unsafeFlags(["-enable-library-evolution", "-no-verify-emitted-module-interface"]))
}

let package = Package(
name: "OpenGraphics",
products: [
.library(name: "OpenGraphics", targets: ["OpenGraphics"]),
.library(name: "OpenGraphicsShims", targets: ["OpenGraphicsShims"]),
.library(name: "OpenQuartzCore", targets: ["OpenQuartzCore"]),
.library(name: "OpenQuartzCoreShims", targets: ["OpenQuartzCoreShims"]),
],
dependencies: [
.package(url: "https://github.com/apple/swift-numerics", from: "1.0.3"),
Expand Down
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ The current suggested toolchain to build the project is Swift 6.1.2 / Xcode 16.4

- [ ] Add more API and types.

Ref: https://github.com/PureSwift/Silicae
Ref:

- https://github.com/PureSwift/Silicae
- https://github.com/gnustep/libs-quartzcore

## Supported platforms

Expand Down