From 1252cf3ca894a934dddd686c49223081bd5541dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Sat, 18 Oct 2014 22:07:59 -0700 Subject: [PATCH] Updated to Emscripten 1.25.0. --- include/bx/platform.h | 17 ++++++++++++----- scripts/toolchain.lua | 41 +++++++++++++++++++---------------------- 2 files changed, 31 insertions(+), 27 deletions(-) diff --git a/include/bx/platform.h b/include/bx/platform.h index edbc438..1a86120 100644 --- a/include/bx/platform.h +++ b/include/bx/platform.h @@ -126,12 +126,14 @@ # define BX_PLATFORM_RPI 1 #elif defined(__native_client__) // NaCl compiler defines __linux__ +# include # undef BX_PLATFORM_NACL -# define BX_PLATFORM_NACL 1 +# define BX_PLATFORM_NACL PPAPI_RELEASE #elif defined(__ANDROID__) // Android compiler defines __linux__ +# include # undef BX_PLATFORM_ANDROID -# define BX_PLATFORM_ANDROID 1 +# define BX_PLATFORM_ANDROID __ANDROID_API__ #elif defined(__linux__) # undef BX_PLATFORM_LINUX # define BX_PLATFORM_LINUX 1 @@ -195,9 +197,13 @@ #endif // BX_COMPILER_ #if BX_PLATFORM_ANDROID -# define BX_PLATFORM_NAME "Android" +# define BX_PLATFORM_NAME "Android " \ + BX_STRINGIZE(BX_PLATFORM_ANDROID) #elif BX_PLATFORM_EMSCRIPTEN -# define BX_PLATFORM_NAME "asm.js" +# define BX_PLATFORM_NAME "asm.js " \ + BX_STRINGIZE(__EMSCRIPTEN_major__) "." \ + BX_STRINGIZE(__EMSCRIPTEN_minor__) "." \ + BX_STRINGIZE(__EMSCRIPTEN_tiny__) #elif BX_PLATFORM_FREEBSD # define BX_PLATFORM_NAME "FreeBSD" #elif BX_PLATFORM_IOS @@ -205,7 +211,8 @@ #elif BX_PLATFORM_LINUX # define BX_PLATFORM_NAME "Linux" #elif BX_PLATFORM_NACL -# define BX_PLATFORM_NAME "NaCl" +# define BX_PLATFORM_NAME "NaCl " \ + BX_STRINGIZE(BX_PLATFORM_NACL) #elif BX_PLATFORM_OSX # define BX_PLATFORM_NAME "OSX" #elif BX_PLATFORM_QNX diff --git a/scripts/toolchain.lua b/scripts/toolchain.lua index 2872ab8..78e6328 100755 --- a/scripts/toolchain.lua +++ b/scripts/toolchain.lua @@ -120,6 +120,7 @@ function toolchain(_buildDir, _libDir) premake.gcc.cc = "$(EMSCRIPTEN)/emcc" premake.gcc.cxx = "$(EMSCRIPTEN)/em++" premake.gcc.ar = "ar" +-- premake.gcc.ar = "$(EMSCRIPTEN)/emar" location (_buildDir .. "projects/" .. _ACTION .. "-asmjs") end @@ -553,13 +554,9 @@ function toolchain(_buildDir, _libDir) targetdir (_buildDir .. "asmjs" .. "/bin") objdir (_buildDir .. "asmjs" .. "/obj") libdirs { _libDir .. "lib/asmjs" } - includedirs { - "$(EMSCRIPTEN)/system/include", - "$(EMSCRIPTEN)/system/include/libc", - } buildoptions { - "-Wno-unknown-warning-option", -- Linux Emscripten doesn't know about no-warn-absolute-paths... - "-Wno-warn-absolute-paths", + "-isystem$(EMSCRIPTEN)/system/include", + "-isystem$(EMSCRIPTEN)/system/include/libc", "-Wunused-value", "-Wundef", } @@ -773,50 +770,50 @@ function strip() configuration { "android-arm", "Release" } postbuildcommands { - "@echo Stripping symbols.", - "@$(ANDROID_NDK_ARM)/bin/arm-linux-androideabi-strip -s \"$(TARGET)\"" + "$(SILENT) echo Stripping symbols.", + "$(SILENT) $(ANDROID_NDK_ARM)/bin/arm-linux-androideabi-strip -s \"$(TARGET)\"" } configuration { "android-mips", "Release" } postbuildcommands { - "@echo Stripping symbols.", - "@$(ANDROID_NDK_MIPS)/bin/mipsel-linux-android-strip -s \"$(TARGET)\"" + "$(SILENT) echo Stripping symbols.", + "$(SILENT) $(ANDROID_NDK_MIPS)/bin/mipsel-linux-android-strip -s \"$(TARGET)\"" } configuration { "android-x86", "Release" } postbuildcommands { - "@echo Stripping symbols.", - "@$(ANDROID_NDK_X86)/bin/i686-linux-android-strip -s \"$(TARGET)\"" + "$(SILENT) echo Stripping symbols.", + "$(SILENT) $(ANDROID_NDK_X86)/bin/i686-linux-android-strip -s \"$(TARGET)\"" } configuration { "linux-* or rpi", "Release" } postbuildcommands { - "@echo Stripping symbols.", - "@strip -s \"$(TARGET)\"" + "$(SILENT) echo Stripping symbols.", + "$(SILENT) strip -s \"$(TARGET)\"" } configuration { "mingw*", "Release" } postbuildcommands { - "@echo Stripping symbols.", - "@$(MINGW)/bin/strip -s \"$(TARGET)\"" + "$(SILENT) echo Stripping symbols.", + "$(SILENT) $(MINGW)/bin/strip -s \"$(TARGET)\"" } configuration { "pnacl" } postbuildcommands { - "@echo Running pnacl-finalize.", - "@" .. naclToolchain .. "finalize \"$(TARGET)\"" + "$(SILENT) echo Running pnacl-finalize.", + "$(SILENT) " .. naclToolchain .. "finalize \"$(TARGET)\"" } configuration { "*nacl*", "Release" } postbuildcommands { - "@echo Stripping symbols.", - "@" .. naclToolchain .. "strip -s \"$(TARGET)\"" + "$(SILENT) echo Stripping symbols.", + "$(SILENT) " .. naclToolchain .. "strip -s \"$(TARGET)\"" } configuration { "asmjs" } postbuildcommands { - "@echo Running asmjs finalize.", - "@$(EMSCRIPTEN)/emcc -O2 -s TOTAL_MEMORY=268435456 \"$(TARGET)\" -o \"$(TARGET)\".html" + "$(SILENT) echo Running asmjs finalize.", + "$(SILENT) $(EMSCRIPTEN)/emcc -O2 -s TOTAL_MEMORY=268435456 \"$(TARGET)\" -o \"$(TARGET)\".html" -- ALLOW_MEMORY_GROWTH }