diff --git a/.github/scripts/Build-Deps-Windows.ps1 b/.github/scripts/Build-Deps-Windows.ps1 index 58543b91..c6b88619 100644 --- a/.github/scripts/Build-Deps-Windows.ps1 +++ b/.github/scripts/Build-Deps-Windows.ps1 @@ -219,6 +219,37 @@ function Build { } else { Log-Information "Failed to locate msbuild.exe - skipping libusb build" } + + Push-Location -Stack BuildMqttTemp + Ensure-Location $ProjectRoot + + $MqttPath = "${ProjectRoot}/deps/paho.mqtt.cpp" + $MqttBuildPath = "${MqttPath}/build" + + # Explicitly disable PkgConfig and tiff as it will lead build errors + $MqttCmakeArgs = @( + "-DCMAKE_BUILD_TYPE=${Configuration}" + "-DCMAKE_PREFIX_PATH:PATH=${OBSDepPath}" + "-DCMAKE_INSTALL_PREFIX:PATH=${ADVSSDepPath}" + "-DPAHO_WITH_MQTT_C=ON" + ) + + Log-Information "Configuring paho.mqtt.cpp..." + Invoke-External cmake -S ${MqttPath} -B ${MqttBuildPath} @MqttCmakeArgs + + $MqttCmakeArgs = @( + '--config', "${Configuration}" + ) + + if ( $VerbosePreference -eq 'Continue' ) { + $MqttCmakeArgs += ('--verbose') + } + + Log-Information "Building paho.mqtt.cpp..." + Invoke-External cmake --build "${MqttBuildPath}" @MqttCmakeArgs + + Log-Information "Install paho.mqtt.cpp..." + Invoke-External cmake --install "${MqttBuildPath}" --prefix "${ADVSSDepPath}" @MqttCmakeArgs } Build diff --git a/.gitmodules b/.gitmodules index 5470f6bd..2c36bb38 100644 --- a/.gitmodules +++ b/.gitmodules @@ -34,3 +34,6 @@ [submodule "deps/jsoncons"] path = deps/jsoncons url = https://github.com/danielaparker/jsoncons.git +[submodule "deps/paho.mqtt.cpp"] + path = deps/paho.mqtt.cpp + url = https://github.com/eclipse-paho/paho.mqtt.cpp.git diff --git a/deps/paho.mqtt.cpp b/deps/paho.mqtt.cpp new file mode 160000 index 00000000..165476b1 --- /dev/null +++ b/deps/paho.mqtt.cpp @@ -0,0 +1 @@ +Subproject commit 165476b1dc248b3f4480f05646086326e1d7d82e