From f1cf5259448b76457a4e0820446e383e8c247a7f Mon Sep 17 00:00:00 2001 From: Maarten Bent Date: Wed, 24 Oct 2018 19:47:18 +0200 Subject: [PATCH] Add CMake option to set wxDEBUG_LEVEL It is no use adding it to the generated setup.h because this section is commented out, so add it as compiler option instead. The default option is 'Default' in which case no compiler option is added. --- build/cmake/init.cmake | 4 ++++ build/cmake/options.cmake | 3 +++ 2 files changed, 7 insertions(+) diff --git a/build/cmake/init.cmake b/build/cmake/init.cmake index 3c07f15b21..fac5a2be3d 100644 --- a/build/cmake/init.cmake +++ b/build/cmake/init.cmake @@ -121,6 +121,10 @@ if(wxUSE_ON_FATAL_EXCEPTION AND MSVC AND (MSVC_VERSION GREATER 1800) ) add_compile_options("/EHa") endif() +if(NOT wxBUILD_DEBUG_LEVEL STREQUAL "Default") + add_compile_options("-DwxDEBUG_LEVEL=${wxBUILD_DEBUG_LEVEL}") +endif() + # Constants for setup.h creation set(wxUSE_STD_DEFAULT ON) if(wxUSE_UNICODE) diff --git a/build/cmake/options.cmake b/build/cmake/options.cmake index b399e7ec2f..19c7344b80 100644 --- a/build/cmake/options.cmake +++ b/build/cmake/options.cmake @@ -23,6 +23,9 @@ wx_option(wxBUILD_COMPATIBILITY set(wxBUILD_CUSTOM_SETUP_HEADER_PATH "" CACHE PATH "Include path containing custom wx/setup.h") mark_as_advanced(wxBUILD_CUSTOM_SETUP_HEADER_PATH) +wx_option(wxBUILD_DEBUG_LEVEL "Debug Level" Default STRINGS Default 0 1 2) +mark_as_advanced(wxBUILD_DEBUG_LEVEL) + if(MSVC) wx_option(wxBUILD_USE_STATIC_RUNTIME "Link using the static runtime library" OFF) wx_option(wxBUILD_MSVC_MULTIPROC "Enable multi-processor compilation for MSVC")