diff --git a/vendor/raylib/raygui.odin b/vendor/raylib/raygui.odin index a15467ae897..559437a60e2 100644 --- a/vendor/raylib/raygui.odin +++ b/vendor/raylib/raygui.odin @@ -3,6 +3,7 @@ package raylib import "core:c" RAYGUI_SHARED :: #config(RAYGUI_SHARED, false) +RAYGUI_WASM_LIB :: #config(RAYGUI_WASM_LIB, "wasm/libraygui.a") when ODIN_OS == .Windows { foreign import lib { @@ -22,6 +23,10 @@ when ODIN_OS == .Windows { "macos/libraygui.dylib" when RAYGUI_SHARED else "macos/libraygui.a", } } +} else when ODIN_ARCH == .wasm32 || ODIN_ARCH == .wasm64p32 { + foreign import lib { + RAYGUI_WASM_LIB, + } } else { foreign import lib "system:raygui" } diff --git a/vendor/raylib/raylib.odin b/vendor/raylib/raylib.odin index 34a803b994a..bb51f105fb9 100644 --- a/vendor/raylib/raylib.odin +++ b/vendor/raylib/raylib.odin @@ -100,6 +100,7 @@ MAX_TEXT_BUFFER_LENGTH :: #config(RAYLIB_MAX_TEXT_BUFFER_LENGTH, 1024) #assert(size_of(rune) == size_of(c.int)) RAYLIB_SHARED :: #config(RAYLIB_SHARED, false) +RAYLIB_WASM_LIB :: #config(RAYLIB_WASM_LIB, "wasm/libraylib.a") when ODIN_OS == .Windows { @(extra_linker_flags="/NODEFAULTLIB:" + ("msvcrt" when RAYLIB_SHARED else "libcmt")) @@ -127,6 +128,10 @@ when ODIN_OS == .Windows { "system:OpenGL.framework", "system:IOKit.framework", } +} else when ODIN_ARCH == .wasm32 || ODIN_ARCH == .wasm64p32 { + foreign import lib { + RAYLIB_WASM_LIB, + } } else { foreign import lib "system:raylib" } diff --git a/vendor/raylib/rlgl/rlgl.odin b/vendor/raylib/rlgl/rlgl.odin index 40913cd505d..340a983de78 100644 --- a/vendor/raylib/rlgl/rlgl.odin +++ b/vendor/raylib/rlgl/rlgl.odin @@ -113,6 +113,7 @@ import rl "../." VERSION :: "5.0" RAYLIB_SHARED :: #config(RAYLIB_SHARED, false) +RAYLIB_WASM_LIB :: #config(RAYLIB_WASM_LIB, "../wasm/libraylib.a") // Note: We pull in the full raylib library. If you want a truly stand-alone rlgl, then: // - Compile a separate rlgl library and use that in the foreign import blocks below. @@ -145,6 +146,10 @@ when ODIN_OS == .Windows { "system:OpenGL.framework", "system:IOKit.framework", } +} else when ODIN_ARCH == .wasm32 || ODIN_ARCH == .wasm64p32 { + foreign import lib { + RAYLIB_WASM_LIB, + } } else { foreign import lib "system:raylib" } diff --git a/vendor/raylib/wasm/libraygui.a b/vendor/raylib/wasm/libraygui.a new file mode 100644 index 00000000000..cfde78a9315 Binary files /dev/null and b/vendor/raylib/wasm/libraygui.a differ diff --git a/vendor/raylib/wasm/libraylib.a b/vendor/raylib/wasm/libraylib.a new file mode 100644 index 00000000000..4cdbfa6948e Binary files /dev/null and b/vendor/raylib/wasm/libraylib.a differ