Skip to content

Use uppercase CMAKE_BUILD_TYPE when asking for CMAKE_CXX_FLAGS, explicitly use -O0 for Debug builds #33896

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

Closed
wants to merge 2 commits into from

Conversation

kubamracek
Copy link
Contributor

No description provided.

@kubamracek
Copy link
Contributor Author

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - c0445ebde3a5393db5a082d8445e4c18573864d8

CMakeLists.txt Outdated
Comment on lines 633 to 635
# CMake's default for CMAKE_CXX_FLAGS_DBEUG is "-g". Let's add "-O0", because we want to be able
# to append CMAKE_CXX_FLAGS_DEBUG to a list of compile flags that already contains a -O flag.
set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this preserve any provided value for CMAKE_CXX_FLAGS_DEBUG by appending -O0 instead of overwriting?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good.

@@ -630,6 +630,10 @@ if("${CMAKE_C_COMPILER_ID}" STREQUAL "MSVC" OR "${CMAKE_CXX_SIMULATE_ID}" STREQU
endif()

if(NOT SWIFT_COMPILER_IS_MSVC_LIKE)
# CMake's default for CMAKE_CXX_FLAGS_DBEUG is "-g". Let's add "-O0", because we want to be able
# to append CMAKE_CXX_FLAGS_DEBUG to a list of compile flags that already contains a -O flag.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

which list already has -O?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mikeash reported this when building a "release swift + debug stdlib" configuration. The stdlib in this case gets the "default compilation flags" and then we append the "debug stdlib" flags.

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - c0445ebde3a5393db5a082d8445e4c18573864d8

@kubamracek
Copy link
Contributor Author

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - c0445ebde3a5393db5a082d8445e4c18573864d8

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - c0445ebde3a5393db5a082d8445e4c18573864d8

@kubamracek
Copy link
Contributor Author

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - c4dcc361ea17c8dae65a3447d1f0a1c8382cb11b

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - c4dcc361ea17c8dae65a3447d1f0a1c8382cb11b

@kubamracek
Copy link
Contributor Author

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 63c9bd1f6b9ad69bfe7137217f5bfc406b2e7d53

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 63c9bd1f6b9ad69bfe7137217f5bfc406b2e7d53

@kubamracek
Copy link
Contributor Author

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 3de1f75

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 3de1f75

@kubamracek
Copy link
Contributor Author

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 3de1f75

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 3de1f75

@kubamracek
Copy link
Contributor Author

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 3de1f75

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 3de1f75

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants