From 3df52dcfbefb8bafa9c85530d5482bcc87c51958 Mon Sep 17 00:00:00 2001 From: SirLynix Date: Mon, 10 Apr 2023 19:20:15 +0200 Subject: [PATCH] Examples: Reduce size of some web examples --- examples/DeferredShading/xmake.lua | 4 ++++ examples/Physics2DDemo/xmake.lua | 4 ++++ examples/PhysicsDemo/xmake.lua | 4 ++++ examples/PhysicsPlayground/xmake.lua | 5 +++++ examples/xmake.lua | 5 ----- 5 files changed, 17 insertions(+), 5 deletions(-) diff --git a/examples/DeferredShading/xmake.lua b/examples/DeferredShading/xmake.lua index 4f4b229f7..904b78039 100644 --- a/examples/DeferredShading/xmake.lua +++ b/examples/DeferredShading/xmake.lua @@ -1,3 +1,7 @@ target("DeferredShading") add_deps("NazaraGraphics") add_files("main.cpp") + + if is_plat("wasm") then + add_ldflags("--preload-file assets/", { force = true }) + end diff --git a/examples/Physics2DDemo/xmake.lua b/examples/Physics2DDemo/xmake.lua index bf4c5dcca..6f239532f 100644 --- a/examples/Physics2DDemo/xmake.lua +++ b/examples/Physics2DDemo/xmake.lua @@ -3,3 +3,7 @@ target("Physics2DDemo") add_packages("entt") add_files("main.cpp") add_defines("NAZARA_ENTT") + + if is_plat("wasm") then + add_ldflags("--preload-file assets/", { force = true }) + end diff --git a/examples/PhysicsDemo/xmake.lua b/examples/PhysicsDemo/xmake.lua index 356c7d89b..d364e4c51 100644 --- a/examples/PhysicsDemo/xmake.lua +++ b/examples/PhysicsDemo/xmake.lua @@ -3,3 +3,7 @@ target("PhysicsDemo") add_packages("entt") add_files("main.cpp") add_defines("NAZARA_ENTT") + + if is_plat("wasm") then + add_ldflags("--preload-file assets/", { force = true }) + end diff --git a/examples/PhysicsPlayground/xmake.lua b/examples/PhysicsPlayground/xmake.lua index 310d1f998..faa466883 100644 --- a/examples/PhysicsPlayground/xmake.lua +++ b/examples/PhysicsPlayground/xmake.lua @@ -3,3 +3,8 @@ target("PhysicsPlayground") add_packages("entt") add_files("main.cpp") add_defines("NAZARA_ENTT") + + if is_plat("wasm") then + add_ldflags("--preload-file assets/examples/dev_grey.png", { force = true }) + add_ldflags("--preload-file assets/examples/Spaceship", { force = true }) + end diff --git a/examples/xmake.lua b/examples/xmake.lua index d2f72e685..95eeef73d 100644 --- a/examples/xmake.lua +++ b/examples/xmake.lua @@ -2,10 +2,5 @@ option("examples", { description = "Build examples", default = true }) if has_config("examples") then set_group("Examples") - - if is_plat("wasm") then - add_ldflags("--preload-file assets/", { force = true }) - end - includes("*/xmake.lua") end