Skip to content

Commit b3b4d77

Browse files
committed
cmake: Disable http-api tests if library not available.
1 parent a487cd4 commit b3b4d77

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

src/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,8 @@ if(WITH_HTTP_API)
119119
if(HTTP_API_DIR)
120120
target_compile_definitions(mosquitto PRIVATE "HTTP_API_DIR=\"${HTTP_API_DIR}\"")
121121
endif()
122+
else()
123+
message(WARNING "microhttpd not found, disabling WITH_HTTP_API")
122124
endif()
123125
endif()
124126

test/broker/CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ add_subdirectory(c)
22

33
file(GLOB PY_TEST_FILES [0-9][0-9]-*.py)
44
file(GLOB PY_PERSIST_TEST_FILES 15-*.py)
5+
file(GLOB PY_HTTP_API_TEST_FILES 22-*.py)
56

67
list(APPEND PY_TEST_FILES "${CMAKE_CURRENT_SOURCE_DIR}/msg_sequence_test.py")
78

@@ -18,6 +19,13 @@ set(EXCLUDE_LIST
1819
08-ssl-bridge-helper
1920
)
2021

22+
if(NOT MICROHTTPD_LIBRARY)
23+
foreach(PY_HTTP_API_TEST_FILE ${PY_HTTP_API_TEST_FILES})
24+
get_filename_component(PY_HTTP_API_TEST_NAME ${PY_HTTP_API_TEST_FILE} NAME_WE)
25+
list(APPEND EXCLUDE_LIST ${PY_HTTP_API_TEST_NAME})
26+
endforeach()
27+
endif()
28+
2129
foreach(PY_PERSIST_TEST_FILE ${PY_PERSIST_TEST_FILES})
2230
get_filename_component(PY_PERSIST_TEST_NAME ${PY_PERSIST_TEST_FILE} NAME_WE)
2331
list(APPEND EXCLUDE_LIST ${PY_PERSIST_TEST_NAME})

0 commit comments

Comments
 (0)