[
https://issues.apache.org/jira/browse/PROTON-2331?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17286628#comment-17286628
]
ASF GitHub Bot commented on PROTON-2331:
----------------------------------------
jiridanek commented on a change in pull request #297:
URL: https://github.com/apache/qpid-proton/pull/297#discussion_r578619627
##########
File path: CMakeLists.txt
##########
@@ -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
+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)
Review comment:
Ack, will rename.
It has the same justification as the `pn_` prefix in the C library. Somebody
might include the CMake build in their own project and then there would be
value in being able to configure options for each project separately. I admit
that here is a poor place where to start introducing the convention. Especially
since I dont intend to apply it uniformly everywhere.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> Allow producing a RelWithDebInfo build with asserts enabled
> -----------------------------------------------------------
>
> Key: PROTON-2331
> URL: https://issues.apache.org/jira/browse/PROTON-2331
> Project: Qpid Proton
> Issue Type: Improvement
> Components: build, proton-c
> Affects Versions: proton-c-0.33.0
> Reporter: Jiri Daněk
> Assignee: Jiri Daněk
> Priority: Major
>
> The LLVM project has a CMake option which enables asserts in C code in any
> build type, including RelWithDebInfo, etc. This seems like an useful thing to
> have.
> It can reduce number of builds needed in CI (we don't have a Debug build for
> MacOS now). Some bugs may only manifest in Release builds. Sanitizers run
> faster on Release builds.
> Coverity warns about assert calls with side effects, so enabling asserts all
> the time should be safe (Coverity would scream if it had any effects on
> functionality).
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]