wasphin commented on code in PR #3553:
URL: https://github.com/apache/brpc/pull/3553#discussion_r4052071477


##########
CMakeLists.txt:
##########
@@ -21,7 +21,12 @@ project(brpc C CXX)
 option(WITH_GLOG "With glog" OFF)
 option(WITH_MESALINK "With MesaLink" OFF)
 option(WITH_BORINGSSL "With BoringSSL" OFF)
-option(DEBUG "Print debug logs" OFF)
+set(BRPC_DEBUG_DEFAULT OFF)
+if(CMAKE_BUILD_TYPE STREQUAL "Debug")
+    set(BRPC_DEBUG_DEFAULT ON)
+endif()
+option(DEBUG "Print debug logs" ${BRPC_DEBUG_DEFAULT})

Review Comment:
   Good point. We can remove the `DEBUG` option altogether. It only controls 
the `NDEBUG` macro, which should be derived from the selected build 
configuration instead. That will also handle build-type changes and 
multi-config generators straightforwardly.



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to