From 61aa670237e2d51f7144322bf56b8ce3633c2db9 Mon Sep 17 00:00:00 2001 From: Ellie Hermaszewska Date: Thu, 24 Oct 2024 11:37:50 +0800 Subject: declutter top level CMakeLists.txt (#5391) * Split examples cmake desc * declutter top level CMakeLists.txt * fail if building tests without gfx * Move llvm fetching to another cmake file * Further split CMakeLists.txt * Neaten llvm fetching * Remove last premake remnant * correct cross builds * Neaten * Neaten project organization in vs --- source/slang-wasm/CMakeLists.txt | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 source/slang-wasm/CMakeLists.txt (limited to 'source/slang-wasm') diff --git a/source/slang-wasm/CMakeLists.txt b/source/slang-wasm/CMakeLists.txt new file mode 100644 index 000000000..d821415e7 --- /dev/null +++ b/source/slang-wasm/CMakeLists.txt @@ -0,0 +1,17 @@ +# +# WebAssembly bindings for Slang +# +# This is an executable target because emcmake produces .a files without bindings if you just create a static library +# https://stackoverflow.com/questions/63622009/static-library-built-with-cmake-as-a-with-emscripten-instead-of-wasm-js +if (EMSCRIPTEN) + slang_add_target( + . + EXECUTABLE + EXCLUDE_FROM_ALL + USE_FEWER_WARNINGS + LINK_WITH_PRIVATE miniz lz4_static slang core compiler-core + INCLUDE_DIRECTORIES_PUBLIC ${slang_SOURCE_DIR}/include . + ) + # To generate binding code + target_link_options(slang-wasm PUBLIC "--bind") +endif() -- cgit v1.2.3