Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cmake: fix
ENABLE_DEBUG=ON
builds in default/release mode
`ENABLE_DEBUG=ON` enables curl-level debug features. Building and running the curl test suite requires setting this option. Before this patch, while building the `testdeps` target with debug features on with the default ('Release') CMake config, the build stopped with this linker error: ``` ld: CMakeFiles/unit1395.dir/unit1395.c.o: in function `test': unit1395.c:(.text+0x1a0): undefined reference to `dedotdotify' A failure has been detected in another branch of the parallel make ``` Ref: https://github.com/curl/curl/actions/runs/9037287098/job/24835990826#step:3:2483 It happened because `dedotdotify` compiled as a static function into `libcurlu` due to the undefined `DEBUGBUILD` macro. Then `unit1395` failed to link it. Even though the build requires the `DEBUGBUILD` macro, our CMake logic defined it when building with CMake's 'Debug' configuration only. That configuration is not required to build or run the test suite, nor to use curl-level debug features. This patch fixes this by always defining `DEBUGBUILD` when setting `ENABLE_DEBUG=ON`. Decoupling this custom option from the selected CMake Release/Debug configuration. This change may also allow dropping Debug mode in AppVeyor CMake builds, possibly making them build faster and run smoother. Ref: curl#13583 Closes curl#13592
- Loading branch information