leaningtech / cheerp-meta

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

Integration with vcpkg #125

Closed Baduit closed 1 year ago

Baduit commented 1 year ago

Hi, I use vcpkg as a package manager in most of my projects, but I did not manage to use cheerp and vcpkg at the same time.

Using this custom made vcpkg triplet

set(VCPKG_TARGET_ARCHITECTURE wasm32)
set(VCPKG_CRT_LINKAGE static)
set(VCPKG_LIBRARY_LINKAGE static)

set(VCPKG_C_FLAGS --target=cheerp-wasm)
set(VCPKG_CXX_FLAGS --target=cheerp-wasm)

set(VCPKG_CMAKE_SYSTEM_NAME Cheerp)
set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE "C:/cheerp/share/cmake/Modules/CheerpWasmToolchain.cmake")

And by replacing all the \ in the cherp toolchain by a / I managed to install a library, but I did not manage to actually consume the installed library

I'm not a vcpkg not a cmake expert and I don't have the time/energy right now to try to make this work, but is something that would be worked on in the future ?

Maqrkk commented 1 year ago

Hi @Baduit,

we are not familiar with vcpkg. Is there a public repository, or a simple setup we can use to reproduce this to investigate further?

Baduit commented 1 year ago

I can make a minimal example reproducing it when I have time

Baduit commented 1 year ago

I finally managed to make it work. The only issue I have now is that something like target_compile_features(my_lib INTERFACE cxx_std_17) is not supported and a lot of libraries are using it.

Maqrkk commented 1 year ago

Hi @Baduit,

The issue should be fixed on master: https://github.com/leaningtech/cheerp-utils/pull/45