]>
Commit | Line | Data |
---|---|---|
1e59de90 TL |
1 | From 111672d5437a3c7f02b66d730be5000dade58bff Mon Sep 17 00:00:00 2001 |
2 | From: Gregor Jasny <gjasny@googlemail.com> | |
3 | Date: Tue, 15 Dec 2020 14:38:37 +0100 | |
4 | Subject: [PATCH] CMake: Add option to disable Debug tools | |
5 | Origin: https://github.com/civetweb/civetweb/pull/952 | |
6 | ||
7 | Sometimes one needs the CMake `Debug` build type | |
8 | to select the Windows Debug runtime. But at the same | |
9 | time the verbose logging output might be unwanted. | |
10 | ||
11 | This PR adds the `CIVETWEB_ENABLE_DEBUG_TOOLS` option | |
12 | to disable extensive logging and assertion. | |
13 | --- | |
14 | CMakeLists.txt | 5 ++++- | |
15 | 1 file changed, 4 insertions(+), 1 deletion(-) | |
16 | ||
17 | diff --git a/CMakeLists.txt b/CMakeLists.txt | |
18 | index 368e5640..000f7972 100644 | |
19 | --- a/CMakeLists.txt | |
20 | +++ b/CMakeLists.txt | |
21 | @@ -476,8 +476,11 @@ endif() | |
22 | ||
23 | ||
24 | # Set up the definitions | |
25 | +option(CIVETWEB_ENABLE_DEBUG_TOOLS "For Debug builds enable verbose logging and assertions" ON) | |
26 | if (${CMAKE_BUILD_TYPE} MATCHES "[Dd]ebug") | |
27 | - add_definitions(-DDEBUG) | |
28 | + if(CIVETWEB_ENABLE_DEBUG_TOOLS) | |
29 | + add_definitions(-DDEBUG) | |
30 | + endif() | |
31 | add_definitions(-O0) | |
32 | add_definitions(-g) | |
33 | endif() | |
34 | -- | |
35 | 2.29.2 | |
36 |