-
Notifications
You must be signed in to change notification settings - Fork 1.4k
[SR-6829] Add "DEBUG" to Xcode debug configuration #1518
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
ed25e3c
e7d4292
3006531
681202b
232c382
b855418
a964e17
cfe4871
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -147,7 +147,7 @@ func xcodeProject( | |
projectSettings.common.COMBINE_HIDPI_IMAGES = "YES" | ||
|
||
// Defined for regular `swift build` instantiations, so also should be defined here. | ||
projectSettings.common.SWIFT_ACTIVE_COMPILATION_CONDITIONS = "SWIFT_PACKAGE" | ||
projectSettings.common.SWIFT_ACTIVE_COMPILATION_CONDITIONS += ["SWIFT_PACKAGE"] | ||
|
||
// Opt out of headermaps. The semantics of the build should be explicitly | ||
// defined by the project structure, so that we don't get any additional | ||
|
@@ -162,8 +162,10 @@ func xcodeProject( | |
projectSettings.debug.DEBUG_INFORMATION_FORMAT = "dwarf" | ||
projectSettings.debug.ENABLE_NS_ASSERTIONS = "YES" | ||
projectSettings.debug.GCC_OPTIMIZATION_LEVEL = "0" | ||
projectSettings.debug.GCC_PREPROCESSOR_DEFINITIONS = ["DEBUG=1", "$(inherited)"] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should be There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I KNOW. but... it's the other way around in the newly created Xcode project. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🤷♂️okay then |
||
projectSettings.debug.ONLY_ACTIVE_ARCH = "YES" | ||
projectSettings.debug.SWIFT_OPTIMIZATION_LEVEL = "-Onone" | ||
projectSettings.debug.SWIFT_ACTIVE_COMPILATION_CONDITIONS += ["DEBUG"] | ||
|
||
// Add some release-specific settings. | ||
projectSettings.release.COPY_PHASE_STRIP = "YES" | ||
|
@@ -452,6 +454,7 @@ func xcodeProject( | |
targetSettings.common.OTHER_CFLAGS = ["$(inherited)"] | ||
targetSettings.common.OTHER_LDFLAGS = ["$(inherited)"] | ||
targetSettings.common.OTHER_SWIFT_FLAGS = ["$(inherited)"] | ||
targetSettings.common.SWIFT_ACTIVE_COMPILATION_CONDITIONS = ["$(inherited)"] | ||
|
||
// Set the correct SWIFT_VERSION for the Swift targets. | ||
if case let swiftTarget as SwiftTarget = target.underlyingTarget { | ||
|
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, I wonder if we should also add this define to C language targets. /cc @ddunbar
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tha makes sense. Should go to the
GCC_PREPROCESSOR_DEFINITIONS
(that's where the Xcode put it for newly created projects)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should add
-DDEBUG=1
here as well: https://github.com/apple/swift-package-manager/blob/master/Sources/Build/BuildPlan.swift#L198There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
along with the
-DSWIFT_PACKAGE=1
or... is it set already?