-
Notifications
You must be signed in to change notification settings - Fork 212
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
PROTON-2331 Allow producing a RelWithDebInfo build with asserts enabled #297
base: main
Are you sure you want to change the base?
Changes from all commits
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 |
---|---|---|
|
@@ -117,7 +117,7 @@ jobs: | |
env: | ||
- PATH="/usr/local/opt/python/libexec/bin:/usr/local/bin:$PATH" | ||
- PKG_CONFIG_PATH='/usr/local/opt/[email protected]/lib/pkgconfig' | ||
- QPID_PROTON_CMAKE_ARGS='-DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 -DTHREADERCISER=ON' | ||
- QPID_PROTON_CMAKE_ARGS='-DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 -DPN_ENABLE_ASSERTIONS=ON -DTHREADERCISER=ON' | ||
# TODO PROTON-2225: c-threaderciser sometimes fails with assertion error | ||
# python-tox-test segfaults and ruby tests do not start due to dynamic library issues | ||
- QPID_PROTON_CTEST_ARGS="--exclude-regex 'c-threaderciser|python-tox-test|ruby.*'" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -132,6 +132,38 @@ if (CMAKE_BUILD_TYPE MATCHES "Coverage") | |
COMMAND ${CMAKE_SOURCE_DIR}/scripts/record-coverage.sh ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR}) | ||
endif() | ||
|
||
# Enable asserts for C/C++ code if requested | ||
# from the LLVM project, https://opensource.apple.com/source/llvmCore/llvmCore-2358.3/CMakeLists.txt.auto.html | ||
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'm considering moving all this into a 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. That might be better - I'm not sure. |
||
if(CMAKE_BUILD_TYPE STREQUAL "Debug" ) | ||
option(PN_ENABLE_ASSERTIONS "Enable assertions" ON) | ||
else() | ||
option(PN_ENABLE_ASSERTIONS "Enable assertions" OFF) | ||
endif() | ||
if(PN_ENABLE_ASSERTIONS) | ||
Comment on lines
+138
to
+142
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. Please call this 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. Ack, will rename. It has the same justification as the |
||
# MSVC doesn't like _DEBUG on release builds. | ||
if(NOT MSVC) | ||
add_definitions(-D_DEBUG) | ||
endif() | ||
Comment on lines
+144
to
+146
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 is not necessary at all - all we need to do is not define 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. Ack, it does look useless. I only included it because thats what LLVM does, and it did not look harmful in any way. |
||
# On non-Debug builds cmake automatically defines NDEBUG, so we explicitly undefine it: | ||
if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug") | ||
# NOTE: use `add_compile_options` rather than `add_definitions` since | ||
# `add_definitions` does not support generator expressions. | ||
add_compile_options($<$<OR:$<COMPILE_LANGUAGE:C>,$<COMPILE_LANGUAGE:CXX>>:-UNDEBUG>) | ||
|
||
# Also remove /D NDEBUG to avoid MSVC warnings about conflicting defines. | ||
foreach (flags_var_to_scrub | ||
CMAKE_CXX_FLAGS_RELEASE | ||
CMAKE_CXX_FLAGS_RELWITHDEBINFO | ||
CMAKE_CXX_FLAGS_MINSIZEREL | ||
CMAKE_C_FLAGS_RELEASE | ||
CMAKE_C_FLAGS_RELWITHDEBINFO | ||
CMAKE_C_FLAGS_MINSIZEREL) | ||
string (REGEX REPLACE "(^| )[/-]D *NDEBUG($| )" " " | ||
"${flags_var_to_scrub}" "${${flags_var_to_scrub}}") | ||
endforeach() | ||
endif() | ||
endif() | ||
|
||
# Try to keep any platform specific overrides together here: | ||
|
||
# MacOS has a bunch of differences in build tools and process and so we have to turn some things | ||
|
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.
See below