From 8671b4dc516994b7f070a341c004aab28e525431 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 5 Nov 2020 15:52:13 +0200 Subject: Initial Emscripten support - Target: wasm32-emscripten (wasm32-unknown-emscripten). - Compiler id: clang-emscripten (type clang, variant emscripten, class gcc). - Ability to build executables (.js plus .wasm) and static libraries (.a). Set executable bit on the .js file (so it can be executed with a suitable binfmt interpreter). - Default config.bin.lib for wasm32-emscripten is static instead of both. - Full C++ exception support is enable unless disabled explicitly by the user with -s DISABLE_EXCEPTION_CATCHING=1|2. - The bin module registers the wasm{} target type for wasm32-emscripten. --- libbuild2/cc/guess.hxx | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'libbuild2/cc/guess.hxx') diff --git a/libbuild2/cc/guess.hxx b/libbuild2/cc/guess.hxx index 3c58bec..868e925 100644 --- a/libbuild2/cc/guess.hxx +++ b/libbuild2/cc/guess.hxx @@ -19,12 +19,13 @@ namespace build2 // // Currently recognized compilers and their ids: // - // gcc GCC gcc/g++ - // clang Vanilla Clang clang/clang++ - // clang-apple Apple Clang clang/clang++ and the gcc/g++ "alias" - // msvc Microsoft cl.exe - // msvc-clang Clang in the cl compatibility mode (clang-cl) - // icc Intel icc/icpc + // gcc GCC gcc/g++ + // clang Vanilla Clang clang/clang++ + // clang-apple Apple Clang clang/clang++ and the gcc/g++ "alias" + // clang-emscripten Emscripten emcc/em++. + // msvc Microsoft cl.exe + // msvc-clang Clang in the cl compatibility mode (clang-cl) + // icc Intel icc/icpc // // Note that the user can provide a custom id with one of the predefined // types and a custom variant (say 'gcc-tasking'). @@ -83,7 +84,7 @@ namespace build2 // // Currently defined compiler classes: // - // gcc gcc, clang, clang-apple, icc (on non-Windows) + // gcc gcc, clang, clang-{apple,emscripten}, icc (on non-Windows) // msvc msvc, clang-cl, icc (Windows) // enum class compiler_class @@ -117,8 +118,9 @@ namespace build2 // // A compiler variant may also have a variant version: // - // clang-apple A.B[.C] ... {A, B, C, ...} - // msvc-clang A.B.C[( |-)...] {A, B, C, ...} (native Clang version) + // clang-apple A.B[.C] ... {A, B, C, ...} + // clang-emscripten A.B.C ... {A, B, C, ...} + // msvc-clang A.B.C[( |-)...] {A, B, C, ...} (native Clang version) // // Note that the clang-apple variant version is a custom Apple version // that doesn't correspond to the vanilla Clang version nor is the mapping @@ -211,6 +213,7 @@ namespace build2 // uclibc // musl // dietlibc + // emscripten // other // none // -- cgit v1.1