mirror of
https://github.com/curl/curl.git
synced 2026-06-01 22:04:15 +03:00
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: 1a62b6e68c (2015-03-03)
Ref: #13583
Closes #13592
This commit is contained in:
parent
d3dbaac3ea
commit
ea98445680
4 changed files with 4 additions and 5 deletions
3
.github/workflows/windows.yml
vendored
3
.github/workflows/windows.yml
vendored
|
|
@ -242,7 +242,6 @@ jobs:
|
|||
fi
|
||||
[ '${{ matrix.type }}' = 'Debug' ] && options+=' -DCMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG='
|
||||
[ '${{ matrix.type }}' = 'Release' ] && options+=' -DCMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE='
|
||||
[ '${{ matrix.type }}' = 'Release' ] && [[ '${{ matrix.config }}' = *'ENABLE_DEBUG=ON'* ]] && cflags+=' -DDEBUGBUILD'
|
||||
cmake -B bld ${options} \
|
||||
"-DCMAKE_C_FLAGS=${cflags}" \
|
||||
"-DCMAKE_RC_COMPILE_OBJECT=${rcopts}" \
|
||||
|
|
@ -294,7 +293,7 @@ jobs:
|
|||
env: '9.5.0-x86_64'
|
||||
url: 'https://github.com/brechtsanders/winlibs_mingw/releases/download/9.5.0-10.0.0-msvcrt-r1/winlibs-x86_64-posix-seh-gcc-9.5.0-mingw-w64msvcrt-10.0.0-r1.7z'
|
||||
config: '-DENABLE_DEBUG=ON -DBUILD_SHARED_LIBS=OFF -DCURL_USE_SCHANNEL=ON -DENABLE_UNICODE=OFF'
|
||||
type: 'Debug'
|
||||
type: 'Release'
|
||||
tflags: '~1139 ~1177 ~1477 ~2301 ~2302 ~3027'
|
||||
- build: 'cmake'
|
||||
env: '7.3.0-x86_64'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue