Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

emscripten support? #520

Open
julhe opened this issue Sep 4, 2023 · 2 comments
Open

emscripten support? #520

julhe opened this issue Sep 4, 2023 · 2 comments

Comments

@julhe
Copy link

julhe commented Sep 4, 2023

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?

@jhopkins-ea
Copy link
Contributor

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

@SirNate0
Copy link

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

Floris0106 added a commit to Floris0106/EASTL that referenced this issue Nov 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants