From 36e06236a9b0b7bf985ffb8e6074ab91d2f88779 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Tue, 21 Jan 2020 17:42:17 -0700 Subject: [PATCH] CMake: Remove IS(_NOT)_DEBUG_BUILD --- dtool/Config.cmake | 25 ++++++++----------------- dtool/Package.cmake | 9 +++------ panda/src/express/CMakeLists.txt | 3 +++ 3 files changed, 14 insertions(+), 23 deletions(-) diff --git a/dtool/Config.cmake b/dtool/Config.cmake index 853e4501fe..b970609bd1 100644 --- a/dtool/Config.cmake +++ b/dtool/Config.cmake @@ -53,14 +53,6 @@ else() endif() # Provide convenient boolean expression based on build type -if(CMAKE_BUILD_TYPE MATCHES "Debug") - set(IS_DEBUG_BUILD True) - set(IS_NOT_DEBUG_BUILD False) -else() - set(IS_DEBUG_BUILD False) - set(IS_NOT_DEBUG_BUILD True) -endif() - if(CMAKE_BUILD_TYPE MATCHES "MinSizeRel") set(IS_MINSIZE_BUILD True) set(IS_NOT_MINSIZE_BUILD False) @@ -299,7 +291,7 @@ option(DO_MEMORY_USAGE enables you to define the variable 'track-memory-usage' at runtime to help track memory leaks, and also report total memory usage on PStats. There is some small overhead for having this ability -available, even if it is unused." ${IS_DEBUG_BUILD}) +available, even if it is unused." OFF) list(APPEND PER_CONFIG_OPTIONS DO_MEMORY_USAGE) set(DO_MEMORY_USAGE_Debug ON CACHE BOOL "") @@ -307,7 +299,7 @@ option(SIMULATE_NETWORK_DELAY "This option compiles in support for simulating network delay via the min-lag and max-lag prc variables. It adds a tiny bit of overhead even when it is not activated, so it is typically enabled -only in a development build." ${IS_DEBUG_BUILD}) +only in a development build." OFF) list(APPEND PER_CONFIG_OPTIONS SIMULATE_NETWORK_DELAY) set(SIMULATE_NETWORK_DELAY_Debug ON CACHE BOOL "") @@ -317,14 +309,14 @@ rendering. Since this is normally useful only for researching buggy drivers, and since there is a tiny bit of per-primitive overhead to have this option available even if it is unused, it is by default enabled only in a development build. This has no effect -on DirectX rendering." ${IS_DEBUG_BUILD}) +on DirectX rendering." OFF) list(APPEND PER_CONFIG_OPTIONS SUPPORT_IMMEDIATE_MODE) set(SUPPORT_IMMEDIATE_MODE_Debug ON CACHE BOOL "") option(NOTIFY_DEBUG "Do you want to include the 'debug' and 'spam' Notify messages? Normally, these are stripped out when we build for release, but sometimes it's -useful to keep them around. Turn this setting on to achieve that." ${IS_DEBUG_BUILD}) +useful to keep them around. Turn this setting on to achieve that." OFF) list(APPEND PER_CONFIG_OPTIONS NOTIFY_DEBUG) set(NOTIFY_DEBUG_Debug ON CACHE BOOL "") @@ -414,10 +406,9 @@ mark_as_advanced(ANDROID_NDK_HOME ANDROID_ABI ANDROID_STL # By default, we'll assume the user only wants to run with Debug # python if he has to--that is, on Windows when building a debug build. -if(WIN32 AND IS_DEBUG_BUILD) - set(USE_DEBUG_PYTHON ON) -else() - set(USE_DEBUG_PYTHON OFF) +set(USE_DEBUG_PYTHON OFF) +if(WIN32) + set(USE_DEBUG_PYTHON_Debug ON) endif() list(APPEND PER_CONFIG_OPTIONS USE_DEBUG_PYTHON) @@ -574,7 +565,7 @@ slightly slow down Panda for the single CPU case." IMPORTED_AS Threads::Threads) # Configure debug threads -option(DEBUG_THREADS "If on, enables debugging of thread and sync operations (i.e. mutexes, deadlocks)" ${IS_DEBUG_BUILD}) +option(DEBUG_THREADS "If on, enables debugging of thread and sync operations (i.e. mutexes, deadlocks)" OFF) list(APPEND PER_CONFIG_OPTIONS DEBUG_THREADS) set(DEBUG_THREADS_Debug ON CACHE BOOL "") diff --git a/dtool/Package.cmake b/dtool/Package.cmake index ccdc4b94d6..fbf014390c 100644 --- a/dtool/Package.cmake +++ b/dtool/Package.cmake @@ -326,13 +326,10 @@ package_option(OpenSSL option(REPORT_OPENSSL_ERRORS "Define this true to include the OpenSSL code to report verbose -error messages when they occur." ${IS_DEBUG_BUILD}) +error messages when they occur." OFF) +option(REPORT_OPENSSL_ERRORS_Debug "" ON) -if(REPORT_OPENSSL_ERRORS) - package_status(OpenSSL "OpenSSL" "with verbose error reporting") -else() - package_status(OpenSSL "OpenSSL") -endif() +package_status(OpenSSL "OpenSSL") # zlib find_package(ZLIB QUIET) diff --git a/panda/src/express/CMakeLists.txt b/panda/src/express/CMakeLists.txt index 0890cb625c..b45a55d11c 100644 --- a/panda/src/express/CMakeLists.txt +++ b/panda/src/express/CMakeLists.txt @@ -149,6 +149,9 @@ target_interrogate(p3express ALL EXTENSIONS ${P3EXPRESS_IGATEEXT}) if(REPORT_OPENSSL_ERRORS) target_compile_definitions(p3express PRIVATE REPORT_OPENSSL_ERRORS) endif() +if(REPORT_OPENSSL_ERRORS_Debug) + target_compile_definitions(p3express PRIVATE $<$:REPORT_OPENSSL_ERRORS>) +endif() if(GETTIMEOFDAY_ONE_PARAM) target_compile_definitions(p3express PRIVATE GETTIMEOFDAY_ONE_PARAM)