Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 28 additions & 23 deletions external/paho_mqtt_c/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,31 +23,36 @@ opendaq_dependency(
if (paho_mqtt_c_FETCHED)


# Apply WIN32_LEAN_AND_MEAN to the Paho MQTT C library as well
if(WIN32)
# Add global compile definition to prevent inclusion of winsock.h and force winsock2.h
foreach(tgt
paho-mqtt3a
paho-mqtt3a-static
paho-mqtt3c
paho-mqtt3c-static
paho-mqtt3as
paho-mqtt3as-static
common_obj
common_ssl_obj
common_obj_static
common_ssl_obj_static
)
if(TARGET ${tgt})
foreach(tgt
paho-mqtt3a
paho-mqtt3a-static
paho-mqtt3c
paho-mqtt3c-static
paho-mqtt3as
paho-mqtt3as-static
common_obj
common_ssl_obj
common_obj_static
common_ssl_obj_static
)
if(TARGET ${tgt})
# Apply WIN32_LEAN_AND_MEAN to the Paho MQTT C library as well
if(WIN32)
# Add global compile definition to prevent inclusion of winsock.h and force winsock2.h
target_compile_definitions("${tgt}" PRIVATE _WINSOCKAPI_ NOMINMAX WIN32_LEAN_AND_MEAN)
if(MSVC)
target_compile_options(${tgt} PRIVATE /WX- /W0)
endif()
endif()
endforeach()
if(MSVC)
target_compile_options(Base64Test PRIVATE /WX- /W0)
target_compile_options(Sha1Test PRIVATE /WX- /W0)

# Don't let warnings in third-party Paho code fail the build (e.g. GCC 15 with
# glibc 2.43 reports discarded-qualifiers on strrchr() in MQTTProtocolOut.c)
if(MSVC)
target_compile_options(${tgt} PRIVATE /WX- /W0)
else()
target_compile_options(${tgt} PRIVATE -Wno-error)
endif()
endif()
endforeach()
if(MSVC)
target_compile_options(Base64Test PRIVATE /WX- /W0)
target_compile_options(Sha1Test PRIVATE /WX- /W0)
endif()
endif()
Loading