--- a/Makefile +++ b/Makefile @@ -663,12 +663,19 @@ # Emscripten ifeq ($(NATIVE), emscripten) - CXX=emcc - LD=emcc + # fredygames.com: em++ no lugar de emcc (o emcc do Emscripten atual nao liga mais a libc++), e + # -DEMSCRIPTEN, que o codigo do jogo testa e o Emscripten atual nao define mais (so __EMSCRIPTEN__); + # sem ele o suporte ao navegador (IndexedDB, menuready, emscripten_sleep) fica de fora do build. + CXX=em++ + LD=em++ ifeq ($(CCACHE), 1) - CXX=$(CCACHEBIN) emcc - LD=$(CCACHEBIN) emcc + CXX=$(CCACHEBIN) em++ + LD=$(CCACHEBIN) em++ endif + DEFINES += -DEMSCRIPTEN + # fredygames.com: sem eval/new Function no JavaScript gerado (o embind usa por padrao), para a + # pagina funcionar com uma Content-Security-Policy sem 'unsafe-eval'. + LDFLAGS += -sDYNAMIC_EXECUTION=0 # Flags that are common across compile and link phases. EMCC_COMMON_FLAGS = -sUSE_SDL=2 -sUSE_SDL_IMAGE=2 -sUSE_SDL_TTF=2 -sSDL2_IMAGE_FORMATS=['png'] -fexceptions