]> git.ipfire.org Git - thirdparty/curl.git/commit
cmake: `ENABLE_DEBUG=ON` to always set `-DDEBUGBUILD`
authorViktor Szakats <commit@vsz.me>
Sat, 11 May 2024 00:44:10 +0000 (02:44 +0200)
committerViktor Szakats <commit@vsz.me>
Mon, 27 May 2024 15:57:52 +0000 (17:57 +0200)
commitea984456804ab3ff1656a668fabdf734a32e379e
treea87a0db2485c4b07a9b4aff28b350ade57a11593
parentd3dbaac3ea59450f8be46343f4cc1fdd01bfaaa3
cmake: `ENABLE_DEBUG=ON` to always set `-DDEBUGBUILD`

Before this patch `ENABLE_DEBUG=ON` always enabled the TrackMemory
(aka `ENABLE_CURLDEBUG=ON`) feature, but required the `Debug` CMake
configration to actually enable curl debug features
(aka `-DDEBUGBUILD`).

Curl debug features do not require compiling with C debug options. This
also made enabling debug features unintuitive and complicated to use.
Due to other issues (subject to PR #13694) it also caused an error in
default (and `Release`/`MinSizeRel`/`RelWithDebInfo`) configs, when
building the `testdeps` target:
```
ld: CMakeFiles/unit1395.dir/unit1395.c.o: in function `test':
unit1395.c:(.text+0x1a0): undefined reference to `dedotdotify'
```
Ref: https://github.com/curl/curl/actions/runs/9037287098/job/24835990826#step:3:2483

Fix it by always defining `DEBUGBUILD` when setting `ENABLE_DEBUG=ON`.
Decoupling this option from the selected CMake configuration.

Note that after this patch `ENABLE_DEBUG=ON` unconditionally enables
curl debug features. These features are insecure and unsuited for
production. Make sure to omit this option when building for production
in default, `Release` (and other not-`Debug`) modes.

Also delete a workaround no longer necessary in GHA CI jobs.

Ref: 1a62b6e68c08c7e471ff22dd92932aba7e026817 (2015-03-03)
Ref: #13583
Closes #13592
.github/workflows/windows.yml
CMakeLists.txt
appveyor.sh
appveyor.yml