@@ -31,21 +31,37 @@ let isXcodeEnv = Context.environment["__CFBundleIdentifier"] == "com.apple.dt.Xc
3131
3232let development = envEnable ( " OPENGRAPHICS_DEVELOPMENT " )
3333
34+ // MARK: - [env] OPENGRAPHICS_COREGRAPHICS
35+
3436let coreGraphicsCondition = envEnable ( " OPENGRAPHICS_COREGRAPHICS " , default: buildForDarwinPlatform)
3537if coreGraphicsCondition {
3638 sharedSwiftSettings. append ( . define( " OPENGRAPHICS_COREGRAPHICS " ) )
3739}
3840
41+ // MARK: - [env] OPENGRAPHICS_WERROR
42+
3943let warningsAsErrorsCondition = envEnable ( " OPENGRAPHICS_WERROR " , default: isXcodeEnv && development)
4044if warningsAsErrorsCondition {
4145 sharedSwiftSettings. append ( . unsafeFlags( [ " -warnings-as-errors " ] ) )
4246}
4347
48+ // MARK: - [env] OPENGRAPHICS_LIBRARY_EVOLUTION
49+
50+ let libraryEvolutionCondition = envEnable ( " OPENGRAPHICS_LIBRARY_EVOLUTION " , default: buildForDarwinPlatform)
51+
52+ if libraryEvolutionCondition {
53+ // NOTE: -enable-library-evolution will cause module verify failure for `swift build`.
54+ // Either set OPENGRAPHICS_LIBRARY_EVOLUTION=0 or add `-Xswiftc -no-verify-emitted-module-interface` after `swift build`
55+ sharedSwiftSettings. append ( . unsafeFlags( [ " -enable-library-evolution " , " -no-verify-emitted-module-interface " ] ) )
56+ }
57+
4458let package = Package (
4559 name: " OpenGraphics " ,
4660 products: [
4761 . library( name: " OpenGraphics " , targets: [ " OpenGraphics " ] ) ,
4862 . library( name: " OpenGraphicsShims " , targets: [ " OpenGraphicsShims " ] ) ,
63+ . library( name: " OpenQuartzCore " , targets: [ " OpenQuartzCore " ] ) ,
64+ . library( name: " OpenQuartzCoreShims " , targets: [ " OpenQuartzCoreShims " ] ) ,
4965 ] ,
5066 dependencies: [
5167 . package ( url: " https://github.com/apple/swift-numerics " , from: " 1.0.3 " ) ,
0 commit comments