summaryrefslogtreecommitdiff
path: root/imgui-1.92.1/examples/example_glfw_wgpu/Makefile.emscripten
diff options
context:
space:
mode:
authorAldrik Ramaekers <aldrikboy@gmail.com>2025-08-09 08:35:03 +0200
committerAldrik Ramaekers <aldrikboy@gmail.com>2025-08-09 08:35:03 +0200
commit432f24319319fe040e142059eb83279c53f90ab8 (patch)
tree5631eb0eb3a46d086070e8398d9080ff681133ac /imgui-1.92.1/examples/example_glfw_wgpu/Makefile.emscripten
parent5d34aff5888d3f0c624251f15bedb96c347978d6 (diff)
refactor 2
Diffstat (limited to 'imgui-1.92.1/examples/example_glfw_wgpu/Makefile.emscripten')
-rw-r--r--imgui-1.92.1/examples/example_glfw_wgpu/Makefile.emscripten92
1 files changed, 0 insertions, 92 deletions
diff --git a/imgui-1.92.1/examples/example_glfw_wgpu/Makefile.emscripten b/imgui-1.92.1/examples/example_glfw_wgpu/Makefile.emscripten
deleted file mode 100644
index 8ee398b..0000000
--- a/imgui-1.92.1/examples/example_glfw_wgpu/Makefile.emscripten
+++ /dev/null
@@ -1,92 +0,0 @@
-#
-# Makefile to use with emscripten
-# See https://emscripten.org/docs/getting_started/downloads.html
-# for installation instructions.
-#
-# This Makefile assumes you have loaded emscripten's environment.
-# (On Windows, you may need to execute emsdk_env.bat or encmdprompt.bat ahead)
-#
-# Running `make` will produce three files:
-# - web/index.html (current stored in the repository)
-# - web/index.js
-# - web/index.wasm
-#
-# All three are needed to run the demo.
-
-CC = emcc
-CXX = em++
-WEB_DIR = web
-EXE = $(WEB_DIR)/index.js
-IMGUI_DIR = ../..
-SOURCES = main.cpp
-SOURCES += $(IMGUI_DIR)/imgui.cpp $(IMGUI_DIR)/imgui_demo.cpp $(IMGUI_DIR)/imgui_draw.cpp $(IMGUI_DIR)/imgui_tables.cpp $(IMGUI_DIR)/imgui_widgets.cpp
-SOURCES += $(IMGUI_DIR)/backends/imgui_impl_glfw.cpp $(IMGUI_DIR)/backends/imgui_impl_wgpu.cpp
-OBJS = $(addsuffix .o, $(basename $(notdir $(SOURCES))))
-UNAME_S := $(shell uname -s)
-CPPFLAGS =
-LDFLAGS =
-EMS =
-
-##---------------------------------------------------------------------
-## EMSCRIPTEN OPTIONS
-##---------------------------------------------------------------------
-
-# ("EMS" options gets added to both CPPFLAGS and LDFLAGS, whereas some options are for linker only)
-# Note: For glfw, we use emscripten-glfw port (contrib.glfw3) instead of (-s USE_GLFW=3) to get a better support for High DPI displays.
-EMS += -s DISABLE_EXCEPTION_CATCHING=1 --use-port=contrib.glfw3
-LDFLAGS += -s USE_WEBGPU=1
-LDFLAGS += -s WASM=1 -s ALLOW_MEMORY_GROWTH=1 -s NO_EXIT_RUNTIME=0 -s ASSERTIONS=1
-
-# Build as single file (binary text encoded in .html file)
-#LDFLAGS += -sSINGLE_FILE
-
-# Emscripten allows preloading a file or folder to be accessible at runtime.
-# The Makefile for this example project suggests embedding the misc/fonts/ folder into our application, it will then be accessible as "/fonts"
-# See documentation for more details: https://emscripten.org/docs/porting/files/packaging_files.html
-# (Default value is 0. Set to 1 to enable file-system and include the misc/fonts/ folder as part of the build.)
-USE_FILE_SYSTEM ?= 0
-ifeq ($(USE_FILE_SYSTEM), 0)
-LDFLAGS += -s NO_FILESYSTEM=1
-CPPFLAGS += -DIMGUI_DISABLE_FILE_FUNCTIONS
-endif
-ifeq ($(USE_FILE_SYSTEM), 1)
-LDFLAGS += --no-heap-copy --preload-file ../../misc/fonts@/fonts
-endif
-
-##---------------------------------------------------------------------
-## FINAL BUILD FLAGS
-##---------------------------------------------------------------------
-
-CPPFLAGS += -I$(IMGUI_DIR) -I$(IMGUI_DIR)/backends
-#CPPFLAGS += -g
-CPPFLAGS += -Wall -Wformat -Os $(EMS)
-#LDFLAGS += --shell-file shell_minimal.html
-LDFLAGS += $(EMS)
-
-##---------------------------------------------------------------------
-## BUILD RULES
-##---------------------------------------------------------------------
-
-%.o:%.cpp
- $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $<
-
-%.o:$(IMGUI_DIR)/%.cpp
- $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $<
-
-%.o:$(IMGUI_DIR)/backends/%.cpp
- $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $<
-
-all: $(EXE)
- @echo Build complete for $(EXE)
-
-$(WEB_DIR):
- mkdir $@
-
-serve: all
- python3 -m http.server -d $(WEB_DIR)
-
-$(EXE): $(OBJS) $(WEB_DIR)
- $(CXX) -o $@ $(OBJS) $(LDFLAGS)
-
-clean:
- rm -f $(EXE) $(OBJS) $(WEB_DIR)/*.js $(WEB_DIR)/*.wasm $(WEB_DIR)/*.wasm.pre