You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At first, trying to build on Windows 10 machine with OpenSSL variables passed in. Testing is enabled by default but would cause the build to fail at compile time. Probably should also check for _WIN32 because I don't think _WINDOWS was being defined. When I added it in manually to the CMakeLists.txt then it could successfully compile. I also tried alternatively adding checks to the test files to guard windows compilation better.
I made changes to make the statements #if !defined(_WINDOWS) && !defined(_WIN32) && !defined(_WIN64) and #if defined(_WINDOWS) || defined(_WIN32) || defined(_WIN64) which successfully compiled and ran the tests for me.
Current work around is to skip it in my compilation with the command: cmake -G "Unix Makefiles" -B build -DCMAKE_INSTALL_PREFIX=/ -DPAHO_BUILD_STATIC=TRUE -DPAHO_ENABLE_TESTING=FALSE -DPAHO_WITH_SSL=TRUE -DOPENSSL_ROOT_DIR="C:\Program Files\OpenSSL-Win64\"
then: cmake --build build/ --target install
which worked as well.
The text was updated successfully, but these errors were encountered:
here is a diff of changes that allowed me to successfully compile with tests enabled in windows. Probably not the best way to go about it but just to show it works...
Ok so VS Code configuration thing, I guess! The extra compile guards could take away the need for that manual step if that's desirable in the future, but this makes sense to me.
paho.mqtt.c/test/thread.c
Line 28 in 6b1e202
At first, trying to build on Windows 10 machine with OpenSSL variables passed in. Testing is enabled by default but would cause the build to fail at compile time. Probably should also check for
_WIN32
because I don't think_WINDOWS
was being defined. When I added it in manually to the CMakeLists.txt then it could successfully compile. I also tried alternatively adding checks to the test files to guard windows compilation better.I made changes to make the statements
#if !defined(_WINDOWS) && !defined(_WIN32) && !defined(_WIN64)
and#if defined(_WINDOWS) || defined(_WIN32) || defined(_WIN64)
which successfully compiled and ran the tests for me.Current work around is to skip it in my compilation with the command:
cmake -G "Unix Makefiles" -B build -DCMAKE_INSTALL_PREFIX=/ -DPAHO_BUILD_STATIC=TRUE -DPAHO_ENABLE_TESTING=FALSE -DPAHO_WITH_SSL=TRUE -DOPENSSL_ROOT_DIR="C:\Program Files\OpenSSL-Win64\"
then:
cmake --build build/ --target install
which worked as well.
The text was updated successfully, but these errors were encountered: