Skip to content

Commit 735e593

Browse files
Detect additional CMake build failures (yhirose#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.
1 parent 748f47b commit 735e593

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

test/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ endif()
2626

2727
find_package(CURL REQUIRED)
2828

29-
add_executable(httplib-test test.cc)
29+
add_executable(httplib-test test.cc include_httplib.cc $<$<BOOL:${WIN32}>:include_windows_h.cc>)
3030
target_compile_options(httplib-test PRIVATE "$<$<CXX_COMPILER_ID:MSVC>:/utf-8;/bigobj>")
3131
target_link_libraries(httplib-test PRIVATE httplib GTest::gtest_main CURL::libcurl)
3232
gtest_discover_tests(httplib-test)

test/include_windows_h.cc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// Test if including windows.h conflicts with httplib.h
2+
3+
#define WIN32_LEAN_AND_MEAN
4+
#include <windows.h>
5+
6+
#include <httplib.h>

0 commit comments

Comments
 (0)