diff --git a/tests/server/CMakeLists.txt b/tests/server/CMakeLists.txt index f88cbf634e..c52a444663 100644 --- a/tests/server/CMakeLists.txt +++ b/tests/server/CMakeLists.txt @@ -42,13 +42,7 @@ target_include_directories(${BUNDLE} PRIVATE "${PROJECT_SOURCE_DIR}/lib" # for "curl_setup.h", curlx "${CMAKE_CURRENT_SOURCE_DIR}" # for the generated bundle source to find included test sources ) -# Test servers simply are standalone programs that do not use libcurl -# library. For convenience and to ease portability of these servers, -# some source code files from the libcurl subdirectory are also used -# 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") 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 5d514b49e7..ff9375fff3 100644 --- a/tests/server/Makefile.am +++ b/tests/server/Makefile.am @@ -48,7 +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 -DCURL_STATICLIB +AM_CPPFLAGS += -DWITHOUT_LIBCURL -DCURL_NO_OLDIES $(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 diff --git a/tests/server/first.h b/tests/server/first.h index b7b795c835..6cd317fec5 100644 --- a/tests/server/first.h +++ b/tests/server/first.h @@ -23,6 +23,18 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ + +/* Test servers simply are standalone programs that do not use libcurl + * library. For convenience and to ease portability of these servers, + * some source code files from the libcurl subdirectory are also used + * 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. + */ +#ifdef _WIN32 +#define CURL_STATICLIB +#endif + #include "curl_setup.h" typedef int (*entry_func_t)(int, char **);