Skip to content

Commit

Permalink
Fix wasm detection
Browse files Browse the repository at this point in the history
  • Loading branch information
rajsite committed Aug 10, 2024
1 parent a8824d2 commit d095c06
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions make-it/EmMakefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@ ifeq ($(filter $(TARGET), $(TARGETS_SUPPORTED)),)
$(error invalid TARGET value, TARGET=$(TARGET) not supported, supported targets are $(TARGETS_SUPPORTED))
endif

ifeq ($(TARGET), wasm32-wasip1)
USING_WASI_TOOLCHAIN=1
endif
ifeq ($(TARGET), wasm32-wasip2)
USING_WASI_TOOLCHAIN=1
endif

BUILDS_SUPPORTED=debug release profile
BUILD=release

Expand Down Expand Up @@ -120,8 +127,7 @@ ifeq ($(TARGET), wasm32-unknown-emscripten)
# The main.obj is not included in library builds
MAINOBJ =
endif

ifeq ($(filter wasm32-wasi, $(TARGET)),)
ifdef USING_WASI_TOOLCHAIN
EMCC=$(WASI_CC)
TARGET_FLAG = -DkVireoOS_wasi -DVIREO_STDIO -DVIREO_FILESYSTEM -DVIREO_FILESYSTEM_DIRLIST
MAINOBJ = $(OBJS)/main.bc
Expand All @@ -134,7 +140,7 @@ endif
# NO_DYNAMIC_EXECUTION=1 Allows Vireo to be used in CSP environments where eval() is forbidden: https://github.com/kripken/emscripten/blob/master/src/settings.js#L563
EM_OPT = $(EM_OPTFLAGS) $(TARGET_FLAG) -std=c++14 -fno-exceptions -Werror --memory-init-file 0 -s NO_DYNAMIC_EXECUTION=1 -s MODULARIZE=1 -s EXPORT_NAME=VireoCreateCoreModule -s EXPORT_ES6=1 -s USE_ES6_IMPORT_META=0 --minify 0 -s NO_FILESYSTEM=1 -s ABORTING_MALLOC=0
WASI_OPT = $(EM_OPTFLAGS) $(TARGET_FLAG) -std=c++14 -fno-exceptions -Werror
ifeq ($(filter wasm32-wasi, $(TARGET)),)
ifdef USING_WASI_TOOLCHAIN
EM_OPT=$(WASI_OPT)
endif
EMFLAGS = -I$(INCDIR) $(EM_OPT)
Expand Down

0 comments on commit d095c06

Please sign in to comment.