leaningtech / cheerp-meta

Cheerp - a C/C++ compiler for Web applications - compiles to WebAssembly and JavaScript
https://labs.leaningtech.com/cheerp
Other
1.03k stars 51 forks source link

Missing: UV_LIBRARY UV_INCLUDE_DIR #70

Closed nazarimilad closed 6 years ago

nazarimilad commented 6 years ago

I'm trying to compile a C++ project using cmake and cheerp's clang.

cmake .. -DWITH_AEON=OFF -DWITH_HTTPD=OFF -DCMAKE_TOOLCHAIN_FILE=/opt/cheerp/share/cmake/Modules/CheerpToolchain.cmake

I get the following error:

-- The C compiler identification is Clang 3.7.0
-- The CXX compiler identification is Clang 3.7.0
-- Check for working C compiler: /opt/cheerp/bin/clang
-- Check for working C compiler: /opt/cheerp/bin/clang -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /opt/cheerp/bin/clang++
-- Check for working CXX compiler: /opt/cheerp/bin/clang++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at /usr/share/cmake-3.9/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
  Could NOT find UV (missing: UV_LIBRARY UV_INCLUDE_DIR)
Call Stack (most recent call first):
  /usr/share/cmake-3.9/Modules/FindPackageHandleStandardArgs.cmake:377 (_FPHSA_FAILURE_MESSAGE)
  cmake/FindUV.cmake:8 (find_package_handle_standard_args)
  CMakeLists.txt:146 (find_package)

-- Configuring incomplete, errors occurred!
See also "/path/to/project/build/CMakeFiles/CMakeOutput.log".

I guess I have to include the UV path in /opt/cheerp/share/cmake/Modules/CheerpToolchain.cmake but I have no idea if this is correct or how to do it. Thanks.

alexp-sssup commented 6 years ago

When compiling a project for the Web platform using Cheerp you need to also compile all the required dependencies, such as libuv in this case. You need to get libuv source and compile it as well. During installation you can put it in any path you like. Afterwards you can use the ccmake command to manually set the UV_LIBRARY UV_INCLUDE_DIR paths to the directory of choice.

Another possibility is to avoid using external dependencies such as libuv since they may not be a good fit for the Web platform in the first place.

nazarimilad commented 6 years ago

I see, thank you for your advice! :)