Detect additional CMake build failures

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.
This commit is contained in:
Florian Albrechtskirchinger 2025-02-16 09:16:50 +01:00
parent 4cb8ff9f90
commit cac09a760f
No known key found for this signature in database
GPG Key ID: 9C4E2AE92D3A9595
2 changed files with 7 additions and 1 deletions

View File

@ -26,7 +26,7 @@ endif()
find_package(CURL REQUIRED)
add_executable(httplib-test test.cc)
add_executable(httplib-test test.cc include_httplib.cc $<$<BOOL:${WIN32}>:include_windows_h.cc>)
target_compile_options(httplib-test PRIVATE "$<$<CXX_COMPILER_ID:MSVC>:/utf-8;/bigobj>")
target_link_libraries(httplib-test PRIVATE httplib GTest::gtest_main CURL::libcurl)
gtest_discover_tests(httplib-test)

View File

@ -0,0 +1,6 @@
// Test if including windows.h conflicts with httplib.h
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <httplib.h>