Skip to content

Commit 1b22a21

Browse files
authored
Fix werror conflict issue (#1)
1 parent 1ddb8f9 commit 1b22a21

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Package.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,16 @@ let buildForDarwinPlatform = envEnable("OPENGRAPHICS_BUILD_FOR_DARWIN_PLATFORM",
2727
let buildForDarwinPlatform = envEnable("OPENGRAPHICS_BUILD_FOR_DARWIN_PLATFORM")
2828
#endif
2929

30+
let isXcodeEnv = Context.environment["__CFBundleIdentifier"] == "com.apple.dt.Xcode"
31+
32+
let development = envEnable("OPENGRAPHICS_DEVELOPMENT")
33+
3034
let coreGraphicsCondition = envEnable("OPENGRAPHICS_COREGRAPHICS", default: buildForDarwinPlatform)
3135
if coreGraphicsCondition {
3236
sharedSwiftSettings.append(.define("OPENGRAPHICS_COREGRAPHICS"))
3337
}
3438

35-
let warningsAsErrorsCondition = envEnable("OPENGRAPHICS_WERROR", default: true)
39+
let warningsAsErrorsCondition = envEnable("OPENGRAPHICS_WERROR", default: isXcodeEnv && development)
3640
if warningsAsErrorsCondition {
3741
sharedSwiftSettings.append(.unsafeFlags(["-warnings-as-errors"]))
3842
}

0 commit comments

Comments
 (0)