Skip to content

Commit

Permalink
Add assets for emscripten
Browse files Browse the repository at this point in the history
  • Loading branch information
Lecrapouille committed Nov 5, 2023
1 parent 9fe418b commit da41240
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,16 @@ DEFINES += -DDATADIR=\"$(DATADIR)\"
CCFLAGS += -Wno-sign-conversion -Wno-float-equal
CXXFLAGS += -Wno-undef -Wno-switch-enum -Wno-enum-compare

###################################################
# Embed assets for web version. Assets shall be
# present inside $(BUILD) folder.
#
ifeq ($(ARCHI),Emscripten)
LINKER_FLAGS += --preload-file imgui.ini
LINKER_FLAGS += --preload-file examples
LINKER_FLAGS += -s FORCE_FILESYSTEM=1
endif

###################################################
# Set thirdpart Raylib
#
Expand Down Expand Up @@ -124,7 +134,18 @@ endif
###################################################
# Compile the project, the static and shared libraries
.PHONY: all
all: $(TARGET)
all: copy-emscripten-assets $(TARGET)

###################################################
#
.PHONY: copy-emscripten-assets
copy-emscripten-assets: | $(BUILD)
ifeq ($(ARCHI),Emscripten)
@$(call print-to,"Copying assets","$(TARGET)","$(BUILD)","")
@cp -r $(P)/data/examples $(BUILD)
@cp $(P)/imgui.ini $(BUILD)
@rm -fr $(BUILD)/examples/pics
endif

###################################################
# Compile and launch unit tests and generate the code coverage html report.
Expand Down

0 comments on commit da41240

Please sign in to comment.