In our project we have a single cmake project, with multiple targets -
backend & tests executables are built with clang, wasm with emscripten. It
works ok - not perfect, because we still need to add a lot of if statements
to handle the different files that belong in different executables, and the
different compilation and linking flags for each target, but it works.

On Wed, 8 Jul 2020 at 20:32, 'Steven Johnson' via emscripten-discuss <
[email protected]> wrote:

> (This question is more CMake-related than Emscripten-related, but I
> suspect someone else on this list may have encountered it, so thought I'd
> ask here...)
>
> TL;DR: Has anyone attempted to use both the Emscripten toolchain and the
> 'host' toolchain (eg gcc, clang) in the same CMake project?
>
> Some of the tooling in this project (e.g. our crosscompiler tool that
> produces .wasm) really needs to be compiled natively, while other parts
> (e.g. the test suite) needs to be compiled via Emscripten. IIUC, CMake has
> a pretty hard distinction of "one toolchain per language per project,
> period" (unlike, say, Blaze/Bazel, which makes this distinction easy).
>
> There are various ways to work around this (CMake's ExternalProject,
> splitting our project into multiple CMake projects, etc) but they all have
> nontrivial drawbacks, so I thought I'd check to see if anyone has found an
> approach that is simpler to implement and maintain.
>
> --
> You received this message because you are subscribed to the Google Groups
> "emscripten-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/emscripten-discuss/CAM%3Ddnvec5z_n7w5THU1%2B0%2BZ5DJ984b9AdPdWN_3HQ6NJx7kYTg%40mail.gmail.com
> <https://groups.google.com/d/msgid/emscripten-discuss/CAM%3Ddnvec5z_n7w5THU1%2B0%2BZ5DJ984b9AdPdWN_3HQ6NJx7kYTg%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/emscripten-discuss/CA%2B_KjGY%3DJBwVns9h-C-h3d226V6FJHS%2BC%3DPzG0awnhsYRCE0wQ%40mail.gmail.com.

Reply via email to