From 735e5930eb36db417547825e4771b6ad10fe043c Mon Sep 17 00:00:00 2001 From: Florian Albrechtskirchinger Date: Sun, 16 Feb 2025 21:45:28 +0100 Subject: [PATCH] Detect additional CMake build failures (#2058) Add include_httplib.cc to the main test executable (already done in Makefile), and add include_windows_h.cc to the main test executable on Windows to test if including windows.h conflicts with httplib.h. --- test/CMakeLists.txt | 2 +- test/include_windows_h.cc | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 test/include_windows_h.cc diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index a9982b9..d4e684c 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -26,7 +26,7 @@ endif() find_package(CURL REQUIRED) -add_executable(httplib-test test.cc) +add_executable(httplib-test test.cc include_httplib.cc $<$:include_windows_h.cc>) target_compile_options(httplib-test PRIVATE "$<$:/utf-8;/bigobj>") target_link_libraries(httplib-test PRIVATE httplib GTest::gtest_main CURL::libcurl) gtest_discover_tests(httplib-test) diff --git a/test/include_windows_h.cc b/test/include_windows_h.cc new file mode 100644 index 0000000..44f541f --- /dev/null +++ b/test/include_windows_h.cc @@ -0,0 +1,6 @@ +// Test if including windows.h conflicts with httplib.h + +#define WIN32_LEAN_AND_MEAN +#include + +#include