summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2024-10-14 10:06:16 -0700
committerGitHub <noreply@github.com>2024-10-14 10:06:16 -0700
commit2e08f33386b65502e16eea33613bddf98ab8b440 (patch)
treefc2b0f8808b5c8bb8659d054387e77c617220f16 /CMakeLists.txt
parente57736bdec06246e32f9deea0ad3cc05a433acb1 (diff)
Fix assert when compiling an entrypoint that calls another entrypoint. (#5268)
* Fix assert when compiling an entrypoint that calls another entrypoint. * Fix test.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt23
1 files changed, 12 insertions, 11 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4e27a724e..0d710c137 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -382,17 +382,18 @@ endif()
#
# 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
-slang_add_target(
- source/slang-wasm
- EXECUTABLE
- EXCLUDE_FROM_ALL
- USE_FEWER_WARNINGS
- LINK_WITH_PRIVATE miniz lz4_static slang core compiler-core
- INCLUDE_DIRECTORIES_PUBLIC include source/slang-wasm
-)
-# To generate binding code
-target_link_options(slang-wasm PUBLIC "--bind")
-
+if(EMSCRIPTEN)
+ slang_add_target(
+ source/slang-wasm
+ EXECUTABLE
+ EXCLUDE_FROM_ALL
+ USE_FEWER_WARNINGS
+ LINK_WITH_PRIVATE miniz lz4_static slang core compiler-core
+ INCLUDE_DIRECTORIES_PUBLIC include source/slang-wasm
+ )
+ # To generate binding code
+ target_link_options(slang-wasm PUBLIC "--bind")
+endif()
#
# Our wrappers for glslang and llvm
#