tomato-testing/examples/example_glfw_wgpu/Makefile.emscripten
Green Sky 0e1b1703f6 Squashed 'external/imgui/imgui/' changes from b475309fa1e..6ccc561a2ab
6ccc561a2ab Version 1.90.6
0d483a1c89f Backends: OpenGL3: Update loader for Linux to support EGL/GLVND. (#7562)
92df32d3390 Backends: OpenGL3: minor update of generated loader to match latest downloaded glcorearb.h/khrplatform.h files.
1ab1af80c74 Backends: Win32: Facepalm revert part of d15574c + additional commentary (#6275)
d15574ce2a5 Backends: Win32: Removed silent return when calling ImGui_ImplWin32_WndProcHandler() with no active context! (#6275)
d4495446d53 Windows, Internal: added experimental SkipRefresh mode. (#3515, #4763, #7556, #5116 , #4076, #2749, #2268)
0b309471f2e Windows: Changed default ClipRect to extend to windows' left and right borders. (#3312, #7540, #3756, #6170, #6365)
0c9c12c1bb9 InnerClipRect use ImFloor() matching docking branch (fix c41868531 for #6861, #2884, followed by rename 94da5842)
6ebbecc6a08 Realign assignments.
fc4d818e170 Tables: Angled headers: added TableAngledHeadersTextAlign, ImGuiStyleVar_TableAngledHeadersTextAlign. (#6917)
4bb75671414 Tables: Angled headers: fixed multi-line label display when angle is flipped. (#6917)
b30df8890de Table: Angled Headers: internal refactor to facilitate changing angled header bg and text colors per column. (#6917)
558c57a086c Fixed static analyzer warning "Pointer to local array 'overlay_buf' is stored outside the scope". Technically not used outside that scope, but best to play nice.
50b2ff0bf03 ImGuiIO: moved IMGUI_DISABLE_OBSOLETE_KEYIO block lower in the structure so other fields layout are not affected by it (#7534)
6ef4f67fa94 ImDrawList: moved cold fields lower in the structure so hot fields are closer to each others + better packed ImGuiNavItemData
a60387a3c25 Backends: GLFW: Add define guards for glfw native defines. (#7536)
913151caa89 Demo: move progress bars to their own section.
c895e987adf ProgressBar: added indeterminate mode by passing an animated negative value. (#5316, #5370, #1901)
b8a44b198c9 TreeNode: added ImGuiTreeNodeFlags_SpanTextWidth. (#6937)
baaaaea9e91 Demo: tweak TreeNode demo.
da18fcb7aed Internals: ensure ButtonBehavior() is called with non 0 id.
b720c0f541c Backends: Vulkan: Added convenience support for Volk via IMGUI_IMPL_VULKAN_USE_VOLK define. (#6582, #4854)
07e8ff9a8d4 Backends: Win32: Fixed a warning + moved header cruft below Changelog.
fa0120ea5ea Windows: Fixed subsequent Begin() append calls from setting last item information for title-bar. (#7506, #823)
361432a0bb2 TreeNode: fixed layout so that TreeNode("") or TreeNode("##HiddenLabel") may properly be used with SameLine(0,0). (#7505, #282)
eba46cb0d22 Drag and Drop: assert when nesting  BeginDragDropSource() and BeginDragDropTarget() (#7504) + update Gallery links
9ec299ebe31 Backends: OpenGL: Detect ES3 contexts on desktop based on version string, (#7447)
7b8107e7c84 Examples: GLFW+WebGPU: Rename example_emscripten_wgpu/ to example_glfw_wgpu/ (#7435, #7132)
648278cd62f Examples: GLFW+WebGPU: Amends. (#7435, #7132)
80a5fdb1089 Examples: GLFW+WebGPU: Fixed condition for when to recreate swapchain. (#7435, #7132)
f9df6bf6622 Examples: GLFW+WebGPU: added support for WebGPU-native/Dawn (#7435, #7132)

git-subtree-dir: external/imgui/imgui
git-subtree-split: 6ccc561a2ab497ad4ae6ee1dbd3b992ffada35cb
2024-05-15 13:22:13 +02:00

89 lines
2.9 KiB
Makefile

#
# 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)
EMS += -s DISABLE_EXCEPTION_CATCHING=1
LDFLAGS += -s USE_GLFW=3 -s USE_WEBGPU=1
LDFLAGS += -s WASM=1 -s ALLOW_MEMORY_GROWTH=1 -s NO_EXIT_RUNTIME=0 -s ASSERTIONS=1
# 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