Add emscripten build files.

This commit is contained in:
Bartosz Taudul 2022-09-30 00:57:53 +02:00
parent 78169326b3
commit ffa48be2d9
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3
5 changed files with 64 additions and 0 deletions

View File

@ -0,0 +1,12 @@
all: release
debug:
@+make -f debug.mk all
release:
@+make -f release.mk all
clean:
@+make -f build.mk clean
.PHONY: all clean debug release db

View File

@ -0,0 +1,19 @@
CC=emcc
CXX=em++
CFLAGS += -sUSE_FREETYPE=1 -pthread
CXXFLAGS := $(CFLAGS) -std=c++17
DEFINES += -DIMGUI_ENABLE_FREETYPE -DIMGUI_IMPL_OPENGL_ES2
INCLUDES := -I../../../imgui -I$(HOME)/.emscripten_cache/sysroot/include/capstone
LIBS += -lpthread -ldl $(HOME)/.emscripten_cache/sysroot/lib/libcapstone.a -sUSE_GLFW=3 -sTOTAL_MEMORY=512mb -sWASM_BIGINT=1 -sPTHREAD_POOL_SIZE=4
PROJECT := Tracy
IMAGE := $(PROJECT)-$(BUILD).html
NO_TBB := 1
FILTER := ../../../nfd/nfd_win.cpp
include ../../../common/src-from-vcxproj.mk
CXXFLAGS += -DTRACY_NO_FILESELECTOR
include ../../../common/unix.mk

View File

@ -0,0 +1,7 @@
CFLAGS := -g3 -gsource-map -Wall
DEFINES := -DDEBUG
BUILD := debug
LIBS := -sDEMANGLE_SUPPORT=1
include ../../../common/unix-debug.mk
include build.mk

View File

@ -0,0 +1,17 @@
from http import server
class MyHTTPRequestHandler(server.SimpleHTTPRequestHandler):
def end_headers(self):
self.send_my_headers()
server.SimpleHTTPRequestHandler.end_headers(self)
def send_my_headers(self):
self.send_header("Cache-Control", "no-cache, no-store, must-revalidate")
self.send_header("Pragma", "no-cache")
self.send_header("Expires", "0")
self.send_header("Cross-Origin-Embedder-Policy", "require-corp");
self.send_header("Cross-Origin-Opener-Policy", "same-origin");
if __name__ == '__main__':
server.test(HandlerClass=MyHTTPRequestHandler)

View File

@ -0,0 +1,9 @@
CFLAGS := -Os
ifndef TRACY_NO_LTO
CFLAGS += -flto
endif
DEFINES := -DNDEBUG
BUILD := release
include ../../../common/unix-release.mk
include build.mk