From 3b8364e00787cb490169ea4f4371a20374047f44 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sat, 28 Jun 2025 02:55:17 +0200 Subject: [PATCH] tests/server: always pass CURL_STATICLIB (also on non-Windows) To avoid generator expressions. Generator expresson do not work with curl_clang_tidy_tests() macro, resulting in an empty `-D` option and breaking clang-tidy: ``` error: macro name must be an identifier [clang-diagnostic-error] ``` https://github.com/curl/curl/actions/runs/15938223758/job/44962176793?pr=17768#step:14:337 But, curl/curl.h behaves the same on non-Windows with tests/server with and without CURL_STATICLIB, making it safe to pass for all platforms. --- tests/server/CMakeLists.txt | 2 +- tests/server/Makefile.am | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/tests/server/CMakeLists.txt b/tests/server/CMakeLists.txt index 5875027767..f88cbf634e 100644 --- a/tests/server/CMakeLists.txt +++ b/tests/server/CMakeLists.txt @@ -48,7 +48,7 @@ target_include_directories(${BUNDLE} PRIVATE # to build the servers. In order to achieve proper linkage of these # files on Windows targets it is necessary to build the test servers # with CURL_STATICLIB defined, independently of how libcurl is built. -target_compile_definitions(${BUNDLE} PRIVATE "WITHOUT_LIBCURL" "CURL_NO_OLDIES" "$<$:CURL_STATICLIB>") +target_compile_definitions(${BUNDLE} PRIVATE "WITHOUT_LIBCURL" "CURL_NO_OLDIES" "CURL_STATICLIB") set_target_properties(${BUNDLE} PROPERTIES OUTPUT_NAME "${BUNDLE}" PROJECT_LABEL "Test ${BUNDLE}" UNITY_BUILD OFF C_CLANG_TIDY "") curl_add_clang_tidy_test_target("${BUNDLE}-clang-tidy" ${BUNDLE} ${FIRST_C} ${UTILS_C} ${TESTS_C}) diff --git a/tests/server/Makefile.am b/tests/server/Makefile.am index 164034ed5c..5d514b49e7 100644 --- a/tests/server/Makefile.am +++ b/tests/server/Makefile.am @@ -48,10 +48,7 @@ CFLAGS += @CURL_CFLAG_EXTRAS@ # Prevent LIBS from being used for all link targets LIBS = $(BLANK_AT_MAKETIME) -AM_CPPFLAGS += -DWITHOUT_LIBCURL -DCURL_NO_OLDIES -if DOING_NATIVE_WINDOWS -AM_CPPFLAGS += -DCURL_STATICLIB -endif +AM_CPPFLAGS += -DWITHOUT_LIBCURL -DCURL_NO_OLDIES -DCURL_STATICLIB $(BUNDLE).c: $(top_srcdir)/scripts/mk-unity.pl Makefile.inc $(FIRST_C) $(UTILS_C) $(CURLX_C) $(TESTS_C) @PERL@ $(top_srcdir)/scripts/mk-unity.pl --include $(UTILS_C) $(CURLX_C) --test $(TESTS_C) > $(BUNDLE).c