libwebsockets icon indicating copy to clipboard operation
libwebsockets copied to clipboard

Build error for Android library with OpenSSL

Open bravepiper opened this issue 3 years ago • 2 comments

I tried to build android library with command below, but it always show the openssl error. Any suggestion to how to fix this kind of error? thanks

  • Command
cmake -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_HOME/build/cmake/android.toolchain.cmake \
          -DANDROID_NDK=$ANDROID_NDK_HOME \
          -DANDROID_ABI=armeabi-v7a \
          -DANDROID_TOOLCHAIN=clang \
          -DANDROID_PLATFORM=android-23 \
          -DANDROID_STL=c++_shared \
          -DLWS_WITHOUT_DAEMONIZE=ON \
          -DLWS_WITHOUT_TESTAPPS=ON \
          -DLWS_IPV6=OFF \
          -DLWS_WITH_BUNDLED_ZLIB=OFF \
          -DLWS_WITH_SSL=ON  \
          -DLWS_WITH_HTTP2=ON \
          -DLWS_WITH_SHARED=OFF \
          -DLWS_OPENSSL_INCLUDE_DIRS=../openssl/include/ \
          -DLWS_OPENSSL_LIBRARIES="../openssl/lib/libssl.so;../openssl/lib/libcrypto.so" \
          ..
  • Error
CMake Error in lib/CMakeLists.txt:
  Target "websockets" INTERFACE_INCLUDE_DIRECTORIES property contains path:

    "/Users/jacky/Downloads/libwebsockets-main/openssl/include"

  which is prefixed in the source directory.

bravepiper avatar Jan 28 '23 13:01 bravepiper

Cmake is telling you that you can't put the openssl includes inside the lws source checkout dir. Put the dir outside lws dirs and point to that instead

lws-team avatar Jan 28 '23 13:01 lws-team

Thanks a lot, I moved the openssl folder to other position and then compiled successfully. @lws-team

bravepiper avatar Jan 28 '23 13:01 bravepiper