[Interest] CMake problems with WASM
Alexandru Croitor
alexandru.croitor at qt.io
Tue Nov 21 15:38:10 CET 2023
Hi,
Configure with
cmake -B build -G Ninja -S .
-DCMAKE_TOOLCHAIN_FILE=/Users/Shared/Qt6.2.0/6.6.0/wasm_singlethread/lib/cmake/Qt6/qt.toolchain.cmake
-DQT_CHAINLOAD_TOOLCHAIN_FILE=<path-to-vcpkg-toolchain>
> On 21. Nov 2023, at 15:04, DAS Loop <dasloop at gmail.com> wrote:
>
>
> Hi,
>
> I have a small test for wasm using cmake that compiles only for the main architecture (in my case macOS).
>
> With Qt installed in the following paths:
> - /Users/Shared/Qt6.2.0/6.6.0/macos
> - /Users/Shared/Qt6.2.0/6.6.0/wasm_singlethread
>
> If I generate the build with:
>
> cmake -B build -G Ninja -S . -DCMAKE_PREFIX_PATH=/Users/Shared/Qt6.2.0/6.6.0/wasm_singlethread
>
> The app is later (cmake --build build) compiled for macOS.
>
> If I did, instead:
>
> cmake -B build -G Ninja -S . -DCMAKE_TOOLCHAIN_FILE=/Users/Shared/Qt6.2.0/6.6.0/wasm_singlethread/lib/cmake/Qt6/qt.toolchain.cmake
>
> The app is compiled for wasm as expected.
>
> Because I´m using vcpkg, using CMAKE_TOOLCHAIN_FILE is not a solution for me.
>
> Any idea of what is wrong?
>
> Thanks,
>
> David
>
> The CMakeLists.txt is:
>
> cmake_minimum_required(VERSION 3.20)
>
> project( main-wasm LANGUAGES CXX )
>
> find_package( Qt6 COMPONENTS Core Widgets REQUIRED )
>
> qt_standard_project_setup()
> qt_add_executable( ${PROJECT_NAME} main.cpp )
>
> target_link_libraries( ${PROJECT_NAME} PRIVATE Qt::Core Qt::Widgets )
>
>
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> https://lists.qt-project.org/listinfo/interest
More information about the Interest
mailing list