-
Notifications
You must be signed in to change notification settings - Fork 10.5k
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
Conversation
@swift-ci please test |
Build failed |
CMakeLists.txt
Outdated
# 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") |
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.
should this preserve any provided value for CMAKE_CXX_FLAGS_DEBUG
by appending -O0
instead of overwriting?
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.
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. |
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.
which list already has -O
?
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.
@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.
Build failed |
c0445eb
to
961d90a
Compare
@swift-ci please test |
Build failed |
Build failed |
c4dcc36
to
63c9bd1
Compare
@swift-ci please test |
Build failed |
Build failed |
…citly use -O0 for Debug builds
63c9bd1
to
3de1f75
Compare
@swift-ci please test |
Build failed |
Build failed |
@swift-ci please test |
Build failed |
Build failed |
@swift-ci please test |
Build failed |
Build failed |
@swift-ci please test |
Build failed |
Build failed |
No description provided.