build: do not apply curl debug macros to tests/server by default

It seems unnecessary and possibly unexpected to build test servers with
debug-enabled features and memory tracking whenever the tested curl is
built like that (which is a requirement for some tests, so curl is
mostly built like that when running tests.) It also makes building
servers a little bit faster with cmake for the most common cases.

You can apply debug options to `tests/server` with these new options:
- `./configure`: `--enable-server-debug`.
- cmake: `-DENABLE_SERVER_DEBUG`.

Also sync the way we pass these macros in autotools, with CMake builds.
Before this patch, autotools passed them via `curl_config.h`. After this
patch it passes them on the command-line, like cmake builds do.

This patch also make these option no longer passed to examples and
`http/client` in cmake builds, where they were no-ops anyway.

Ref: #15000
Closes #16705
This commit is contained in:
Viktor Szakats 2025-03-12 22:41:57 +01:00
parent 43b2884655
commit a16485a42e
No known key found for this signature in database
GPG key ID: B5ABD165E2AEF201
14 changed files with 65 additions and 7 deletions

View file

@ -22,6 +22,7 @@
#
###########################################################################
set(EXE_NAME curl)
set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS "${CURL_DEBUG_MACROS}")
set(_curl_cfiles_gen "")
set(_curl_hfiles_gen "")

View file

@ -51,6 +51,12 @@ bin_PROGRAMS = curl
if USE_CPPFLAG_CURL_STATICLIB
AM_CPPFLAGS += -DCURL_STATICLIB
endif
if DEBUGBUILD
AM_CPPFLAGS += -DDEBUGBUILD
endif
if CURLDEBUG
AM_CPPFLAGS += -DCURLDEBUG
endif
AM_LDFLAGS =
if USE_UNICODE