electronicarts/EASTL

emscripten support?

julhe opened this issue · 2 comments

julhe commented

Currently, building for emscripten fails with:

/SourceExternal/EASTL/test/packages/EABase/include/Common\EABase/config/eaplatform.h:623:3: error: Unknown platform
        #error Unknown platform
         ^
/SourceExternal/EASTL/test/packages/EABase/include/Common\EABase/config/eaplatform.h:624:3: error: Unknown processor
        #error Unknown processor
         ^
/SourceExternal/EASTL/test/packages/EABase/include/Common\EABase/config/eaplatform.h:625:3: error: Unknown endianness
        #error Unknown endianness

Is support ever planed or is it ouside the scope of this project?

Hi. No, this isn't planned for EABase or EASTL.

I think it basically supports it as is (no real testing done, but it compiles and tuple-vector worked fine). I just added the following to eaplatform.h

--- a/eastl/EABase/config/eaplatform.h
+++ b/eastl/EABase/config/eaplatform.h
@@ -619,6 +619,16 @@
 // __sun is defined by the GCC compiler.
 // __i386 is defined by the Sun and GCC compilers.
 // __sparc is defined by the Sun and GCC compilers.
+
+#elif defined(__EMSCRIPTEN__) || defined(__wasm__) || defined(__wasm32__) || defined(__wasm64__)
+       #define EA_PROCESSOR_EMSCRIPTEN 1
+       #define EA_SYSTEM_LITTLE_ENDIAN 1
+       #define EA_PLATFORM_DESCRIPTION "Emscripten WASM"
+       #define EA_PLATFORM_POSIX 1
+       #define EASTL_DEBUG_BREAK_OVERRIDE 1 // disable it
+
 #else
        #error Unknown platform
        #error Unknown processor