Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
3a350f5
Use JsRuntimeHost switches for Embedding polyfills
bghgary Sep 29, 2026
341cba5
Adopt renamed JsRuntimeHost AbortController option
bghgary Sep 29, 2026
2de3300
Install required Embedding polyfills
bghgary Sep 29, 2026
befb2ca
Honor NativeEngine WebP parsing when generic bimg parsers are disabled
bghgary Sep 29, 2026
0ea8682
Remove synthetic WebP parser test fixture
bghgary Sep 29, 2026
d310127
Keep polyfill documentation focused on current options
bghgary Sep 29, 2026
8f26609
Remove Embedding switch notes from polyfills guide
bghgary Sep 29, 2026
41a231c
Make bimg format options the sole parser controls
bghgary Sep 29, 2026
aad14cf
Expose one native image parser format selection
bghgary Sep 30, 2026
63d2780
Move image parser selection beside NativeEngine options
bghgary Sep 30, 2026
d6fd407
Use dependency image parser controls and enable AVIF by default
bghgary Sep 30, 2026
1ae5a69
Merge master to include Mesa module-load fix
bghgary Sep 30, 2026
dea671e
Pin remotely available image parser dependency revisions
bghgary Sep 30, 2026
6314aac
Update image parser wrapper to merged upstream bimg fix
bghgary Sep 30, 2026
95b0a2a
Pin explicit parser options and separate WIC backend configuration
bghgary Sep 30, 2026
c268265
Keep parser list changes effective with boolean dependency options
bghgary Sep 30, 2026
4221136
Pin wrapper with anticipated WIC backend control
bghgary Oct 1, 2026
07c75f1
Pin wrapper with WIC disabled by default
bghgary Oct 1, 2026
0905203
Pin wrapper with inherited per-format parser defaults
bghgary Oct 1, 2026
7d9e993
Merge upstream readback fixes and retain combined parser wrapper
bghgary Oct 1, 2026
71b7ab4
Pin parser-only wrapper without anticipated WIC control
bghgary Oct 1, 2026
c087d91
Use merged upstream image parser configuration
bghgary Oct 1, 2026
ebfc141
Use bgfx.cmake image parser controls directly
bghgary Oct 1, 2026
ffcd897
Limit default image parsers to Babylon.js formats
bghgary Oct 1, 2026
4804e7d
Test installed Embedding linkage and require Scheduling for Window
bghgary Oct 1, 2026
caeb1ec
Disable unsupported image parsers unconditionally
bghgary Oct 1, 2026
fd00b23
Move image parser configuration to the building guide
bghgary Oct 1, 2026
5f795bd
Preserve original Window dependency ordering
bghgary Oct 1, 2026
6f92554
Merge upstream WIC decoder update and current native fixes
bghgary Oct 2, 2026
7d5d1c5
Adopt upstream WIC decoder configuration
bghgary Oct 2, 2026
7d9f6c0
Enable WIC by default on Windows
bghgary Oct 2, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 16 additions & 6 deletions Apps/UnitTests/JavaScript/dist/tests.javaScript.all.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,22 @@ function _createForOfIteratorHelper(r, e) {var t = "undefined" != typeof Symbol

var fixtures = [
{
name: "16-bit RGBA", width: 4,
name: "16-bit RGBA", width: 4, tolerance: 1,
png: "iVBORw0KGgoAAAANSUhEUgAAAAQAAAABEAYAAACprNOOAAAAI0lEQVR4nGOo/38v9Ene//8MDP//NzBAeAwMIB4D4/9/90IBNYURsvcM43UAAAAASUVORK5CYII=",
pixels: [128, 222, 227, 255, 0, 255, 128, 128, 222, 227, 0, 0, 255, 0, 255, 222]
},
{
name: "16-bit RGB", width: 4,
name: "16-bit RGB", width: 4, tolerance: 1,
png: "iVBORw0KGgoAAAANSUhEUgAAAAQAAAABEAIAAAAmzkTZAAAAG0lEQVR4nGOo/38v9EkeA8P//w0MMBYD4/9/AKWbDQOAUd17AAAAAElFTkSuQmCC",
pixels: [128, 222, 227, 255, 0, 255, 128, 255, 222, 227, 0, 255, 255, 0, 255, 255]
},
{
name: "16-bit grayscale", width: 4,
name: "16-bit grayscale", width: 4, tolerance: 1,
png: "iVBORw0KGgoAAAANSUhEUgAAAAQAAAABEAAAAACMx4xSAAAAEUlEQVR4nGOo/38v9Ene//8AGa4GAvbhooAAAAAASUVORK5CYII=",
pixels: [128, 128, 128, 255, 222, 222, 222, 255, 227, 227, 227, 255, 255, 255, 255, 255]
},
{
name: "16-bit grayscale with alpha", width: 4,
name: "16-bit grayscale with alpha", width: 4, tolerance: 1,
png: "iVBORw0KGgoAAAANSUhEUgAAAAQAAAABEAQAAAADpRsFAAAAF0lEQVR4nGOo/////73Q+v9P8hgYQCwAYP8KsdIXi8oAAAAASUVORK5CYII=",
pixels: [128, 128, 128, 255, 222, 222, 222, 128, 227, 227, 227, 0, 255, 255, 255, 222]
},
Expand All @@ -55,6 +55,16 @@ var fixtures = [
}];


function expectPixels(pixels, fixture) {
(0,chai__WEBPACK_IMPORTED_MODULE_2__.expect)(pixels.length).to.equal(fixture.pixels.length);
// WIC and bundled decoders quantize 16-bit channels to 8-bit with different rounding.
for (var index = 0; index < pixels.length; ++index) {var _fixture$tolerance;
var expected = fixture.pixels[index];
var tolerance = expected === 0 || expected === 255 ? 0 : (_fixture$tolerance = fixture.tolerance) !== null && _fixture$tolerance !== void 0 ? _fixture$tolerance : 0;
(0,chai__WEBPACK_IMPORTED_MODULE_2__.expect)(pixels[index], "channel ".concat(index)).to.be.closeTo(expected, tolerance);
}
}

function registerPngTests(
describe,
it,
Expand All @@ -80,7 +90,7 @@ enabled)
pixels instanceof Uint8Array) {_context.next = 4;break;}throw (
new Error("Expected unsigned-byte PNG texture readback"));case 4:

(0,chai__WEBPACK_IMPORTED_MODULE_2__.expect)(Array.from(pixels)).to.deep.equal(fixture.pixels);
expectPixels(pixels, fixture);
(0,chai__WEBPACK_IMPORTED_MODULE_2__.expect)(texture.getSize().width).to.equal(fixture.width);
(0,chai__WEBPACK_IMPORTED_MODULE_2__.expect)(texture.getSize().height).to.equal(1);if (!
generateMips) {_context.next = 6;break;}
Expand All @@ -103,7 +113,7 @@ enabled)
(0,chai__WEBPACK_IMPORTED_MODULE_2__.expect)(bitmap.width).to.equal(fixture.width);
(0,chai__WEBPACK_IMPORTED_MODULE_2__.expect)(bitmap.height).to.equal(1);
pixels = engine.resizeImageBitmap(bitmap, fixture.width, 1);
(0,chai__WEBPACK_IMPORTED_MODULE_2__.expect)(Array.from(pixels)).to.deep.equal(fixture.pixels);case 3:_context2.prev = 3;
expectPixels(pixels, fixture);case 3:_context2.prev = 3;

engine.dispose();return _context2.finish(3);case 4:case "end":return _context2.stop();}}, _callee2, null, [[1,, 3, 4]]);}))

Expand Down
24 changes: 17 additions & 7 deletions Apps/UnitTests/JavaScript/src/tests.nativeEngine.png.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,24 @@ import * as Mocha from "mocha";
import { expect } from "chai";
import { Constants, NativeEngine, Scene, Texture } from "@babylonjs/core";

const fixtures: { name: string; png: string; pixels: number[]; width: number }[] = [
const fixtures: { name: string; png: string; pixels: number[]; width: number; tolerance?: number }[] = [
{
name: "16-bit RGBA", width: 4,
name: "16-bit RGBA", width: 4, tolerance: 1,
png: "iVBORw0KGgoAAAANSUhEUgAAAAQAAAABEAYAAACprNOOAAAAI0lEQVR4nGOo/38v9Ene//8MDP//NzBAeAwMIB4D4/9/90IBNYURsvcM43UAAAAASUVORK5CYII=",
pixels: [128, 222, 227, 255, 0, 255, 128, 128, 222, 227, 0, 0, 255, 0, 255, 222],
},
{
name: "16-bit RGB", width: 4,
name: "16-bit RGB", width: 4, tolerance: 1,
png: "iVBORw0KGgoAAAANSUhEUgAAAAQAAAABEAIAAAAmzkTZAAAAG0lEQVR4nGOo/38v9EkeA8P//w0MMBYD4/9/AKWbDQOAUd17AAAAAElFTkSuQmCC",
pixels: [128, 222, 227, 255, 0, 255, 128, 255, 222, 227, 0, 255, 255, 0, 255, 255],
},
{
name: "16-bit grayscale", width: 4,
name: "16-bit grayscale", width: 4, tolerance: 1,
png: "iVBORw0KGgoAAAANSUhEUgAAAAQAAAABEAAAAACMx4xSAAAAEUlEQVR4nGOo/38v9Ene//8AGa4GAvbhooAAAAAASUVORK5CYII=",
pixels: [128, 128, 128, 255, 222, 222, 222, 255, 227, 227, 227, 255, 255, 255, 255, 255],
},
{
name: "16-bit grayscale with alpha", width: 4,
name: "16-bit grayscale with alpha", width: 4, tolerance: 1,
png: "iVBORw0KGgoAAAANSUhEUgAAAAQAAAABEAQAAAADpRsFAAAAF0lEQVR4nGOo/////73Q+v9P8hgYQCwAYP8KsdIXi8oAAAAASUVORK5CYII=",
pixels: [128, 128, 128, 255, 222, 222, 222, 128, 227, 227, 227, 0, 255, 255, 255, 222],
},
Expand All @@ -35,6 +35,16 @@ const fixtures: { name: string; png: string; pixels: number[]; width: number }[]
},
];

function expectPixels(pixels: Uint8Array, fixture: typeof fixtures[number]): void {
expect(pixels.length).to.equal(fixture.pixels.length);
// WIC and bundled decoders quantize 16-bit channels to 8-bit with different rounding.
for (let index = 0; index < pixels.length; ++index) {
const expected = fixture.pixels[index];
const tolerance = expected === 0 || expected === 255 ? 0 : fixture.tolerance ?? 0;
expect(pixels[index], `channel ${index}`).to.be.closeTo(expected, tolerance);
}
}

export function registerPngTests(
describe: typeof Mocha.describe,
it: typeof Mocha.it,
Expand All @@ -60,7 +70,7 @@ export function registerPngTests(
if (!(pixels instanceof Uint8Array)) {
throw new Error("Expected unsigned-byte PNG texture readback");
}
expect(Array.from(pixels)).to.deep.equal(fixture.pixels);
expectPixels(pixels, fixture);
expect(texture.getSize().width).to.equal(fixture.width);
expect(texture.getSize().height).to.equal(1);
if (generateMips) {
Expand All @@ -83,7 +93,7 @@ export function registerPngTests(
expect(bitmap.width).to.equal(fixture.width);
expect(bitmap.height).to.equal(1);
const pixels = engine.resizeImageBitmap(bitmap, fixture.width, 1);
expect(Array.from(pixels)).to.deep.equal(fixture.pixels);
expectPixels(pixels, fixture);
} finally {
engine.dispose();
}
Expand Down
8 changes: 8 additions & 0 deletions BUILDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,14 @@ export CXX=/usr/bin/g++

You will have to run CMake again to take changes into account.

## Image Format Parsing

Bundled image parsers default to AVIF, BMP, EXR, GIF, HDR, JPEG, PNG, TGA, and WebP, matching browser image formats and Babylon.js texture loaders. PIC, PNM, and PSD are disabled by Babylon Native; HEIF is OFF upstream.

Configure the supported formats with bgfx.cmake's `BIMG_CONFIG_PARSE_<FORMAT>` settings (`ON`, `OFF`, or empty), for example `-DBIMG_CONFIG_PARSE_WEBP=OFF`. Empty values inherit `BIMG_CONFIG_PARSE_ENABLE`, which defaults to ON. PIC, PNM, and PSD remain disabled regardless of cache or parent-project settings. These settings do not control bimg's texture-container parsers.

On Windows, Windows Imaging Component (WIC) decoding defaults to ON for enabled PNG, JPEG, BMP, and GIF formats instead of their bundled decoders. Set `-DBIMG_CONFIG_USE_WIC=OFF` to use the bundled decoders. Explicit cache and parent-project settings are respected; WIC does not enable formats disabled by their `BIMG_CONFIG_PARSE_<FORMAT>` settings.

## Selecting the Graphics API

For Win32, UWP, Android, and Linux, it's possible to build for different graphics API.
Expand Down
13 changes: 2 additions & 11 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ FetchContent_Declare(base-n
EXCLUDE_FROM_ALL)
FetchContent_Declare(bgfx.cmake
GIT_REPOSITORY https://github.com/BabylonJS/bgfx.cmake.git
GIT_TAG 8edfdc308848df5bb86fc1af0228080deda0045b
GIT_TAG 9a7a35ed0d588c64de867c5e5c7f990676da8c21
EXCLUDE_FROM_ALL)
FetchContent_Declare(CMakeExtensions
GIT_REPOSITORY https://github.com/BabylonJS/CMakeExtensions.git
Expand All @@ -62,7 +62,7 @@ FetchContent_Declare(ios-cmake
EXCLUDE_FROM_ALL)
FetchContent_Declare(JsRuntimeHost
GIT_REPOSITORY https://github.com/BabylonJS/JsRuntimeHost.git
GIT_TAG b2b51ca86737cf8145235226b7591c191a94355a)
GIT_TAG 33e4a233dea178712352ec90a647683084bfbf1d)
FetchContent_Declare(metal-cpp
GIT_REPOSITORY https://github.com/bkaradzic/metal-cpp.git
GIT_TAG metal-cpp_26
Expand Down Expand Up @@ -128,12 +128,7 @@ option(BABYLON_NATIVE_PLUGIN_NATIVECAPTURE "Include Babylon Native Plugin Native
option(BABYLON_NATIVE_PLUGIN_NATIVEDRACO "Include Babylon Native Plugin NativeDraco." OFF)
option(BABYLON_NATIVE_PLUGIN_NATIVEENCODING "Include Babylon Native Plugin NativeEncoding." ON)
option(BABYLON_NATIVE_PLUGIN_NATIVEENGINE "Include Babylon Native Plugin NativeEngine." ON)
option(BABYLON_NATIVE_PLUGIN_NATIVEENGINE_WEBP "Enable WebP image parsing in NativeEngine (via bimg)." ON)
option(BABYLON_NATIVE_PLUGIN_NATIVEENGINE_LOAD_IMAGES "Enable image loading in NativeEngine (LoadTexture, image bitmap, bimg)." ON)
if(NOT BABYLON_NATIVE_PLUGIN_NATIVEENGINE_LOAD_IMAGES)
# WebP support relies on image loading code paths; force it off when image loading is disabled.
set(BABYLON_NATIVE_PLUGIN_NATIVEENGINE_WEBP OFF CACHE BOOL "Enable WebP image parsing in NativeEngine (via bimg)." FORCE)
endif()
option(BABYLON_NATIVE_PLUGIN_NATIVEENGINE_COMPILESHADERS "Include Babylon Native Plugin NativeEngine - Compile Shaders." ON)
option(BABYLON_NATIVE_PLUGIN_NATIVEINPUT "Include Babylon Native Plugin NativeInput." ON)
option(BABYLON_NATIVE_PLUGIN_NATIVEMESHOPT "Include Babylon Native Plugin NativeMeshopt." OFF)
Expand All @@ -146,11 +141,7 @@ option(BABYLON_NATIVE_PLUGIN_SHADERTOOL "Include Babylon Native Plugin ShaderToo
option(BABYLON_NATIVE_PLUGIN_TESTUTILS "Include Babylon Native Plugin TestUtils." ON)

# Polyfills
option(BABYLON_NATIVE_POLYFILL_ABORTCONTROLLER "Include Babylon Native Polyfill AbortController." ON)
option(BABYLON_NATIVE_POLYFILL_CANVAS "Include Babylon Native Polyfill Canvas." ON)
option(BABYLON_NATIVE_POLYFILL_SCHEDULING "Include Babylon Native Polyfill Scheduling." ON)
option(BABYLON_NATIVE_POLYFILL_URL "Include Babylon Native Polyfill URL." ON)
option(BABYLON_NATIVE_POLYFILL_WEBSOCKET "Include Babylon Native Polyfill WebSocket." ON)
option(BABYLON_NATIVE_POLYFILL_WINDOW "Include Babylon Native Polyfill Window." ON)

# Embedding
Expand Down
17 changes: 7 additions & 10 deletions Dependencies/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,13 @@ set(BGFX_OPENGL_USE_EGL ON)
set(BGFX_USE_DEBUG_SUFFIX OFF)
set(BGFX_CONFIG_VIDEO OFF)

# Keep AVIF opt-in, including caches with bgfx.cmake's empty (inherit) default.
if(NOT DEFINED BIMG_CONFIG_PARSE_AVIF OR "${BIMG_CONFIG_PARSE_AVIF}" STREQUAL "")
set(BIMG_CONFIG_PARSE_AVIF OFF)
# These formats have neither browser image support nor Babylon.js texture loaders.
set(BIMG_CONFIG_PARSE_PIC OFF)
set(BIMG_CONFIG_PARSE_PNM OFF)
set(BIMG_CONFIG_PARSE_PSD OFF)

if(WIN32 AND NOT DEFINED BIMG_CONFIG_USE_WIC)
set(BIMG_CONFIG_USE_WIC ON)
endif()

FetchContent_MakeAvailable_With_Message(bgfx.cmake)
Expand Down Expand Up @@ -106,13 +110,6 @@ foreach(_bimg_target IN ITEMS bimg_decode bimg_encode tinyexr)
endif()
endforeach()

# WebP parsing is provided by bimg's bundled simplewebp decoder. Toggle it
# through bimg's own config macro so disabling the option compiles the parser
# out of bimg_decode instead of pulling in a separate libwebp dependency.
if(NOT BABYLON_NATIVE_PLUGIN_NATIVEENGINE_WEBP AND TARGET bimg_decode)
target_compile_definitions(bimg_decode PRIVATE BIMG_CONFIG_PARSE_WEBP=0)
endif()

if(NOT APPLE AND NOT ANDROID AND CMAKE_SYSTEM_PROCESSOR MATCHES "(x86_64|amd64|AMD64)" AND CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
foreach(_bx_target IN ITEMS bx bgfx bimg bimg_decode bimg_encode)
if(TARGET ${_bx_target})
Expand Down
10 changes: 0 additions & 10 deletions Documentation/BuildSystem.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,6 @@ and it should be easy to incorporate Babylon Native into other existing projects
document provides an overview of the concepts underpinning the Babylon Native build system
and outlines some of the reasoning and intent behind them.

## Image Format Parsing

Native AVIF image decoding is disabled by default. This excludes the libavif and
dav1d sources from the bimg decoder build; other image-format defaults are unchanged.

To enable AVIF support, configure Babylon Native with `-DBIMG_CONFIG_PARSE_AVIF=ON`.
An explicit setting from a parent CMake project is also respected. Unset or empty
values use Babylon Native's disabled default, including empty cache entries left by
earlier configurations.

## Lateral Dependency Management

Scalable dependency management can be a challenge when making heavy use of Git Submodules.
Expand Down
21 changes: 10 additions & 11 deletions Embedding/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,8 @@ target_link_libraries(Embedding

# ----- Conditionally-included polyfills -----
#
# Each flag is exposed as a PUBLIC compile definition so the public
# headers (Runtime.h / View.h) and the impl source files can both gate
# on the same value via `#if BABYLON_NATIVE_*`.
# Public compile definitions are used for options exposed by public
# headers; JsRuntimeHost polyfills only need private definitions.

if(BABYLON_NATIVE_POLYFILL_WINDOW)
target_compile_definitions(Embedding PUBLIC BABYLON_NATIVE_POLYFILL_WINDOW=1)
Expand All @@ -60,23 +59,23 @@ if(BABYLON_NATIVE_POLYFILL_CANVAS)
target_link_libraries(Embedding PRIVATE Canvas)
endif()

if(BABYLON_NATIVE_POLYFILL_ABORTCONTROLLER)
target_compile_definitions(Embedding PUBLIC BABYLON_NATIVE_POLYFILL_ABORTCONTROLLER=1)
if(TARGET AbortController)
target_compile_definitions(Embedding PRIVATE JSRUNTIMEHOST_POLYFILL_ABORTCONTROLLER=1)
target_link_libraries(Embedding PRIVATE AbortController)
endif()

if(BABYLON_NATIVE_POLYFILL_SCHEDULING)
target_compile_definitions(Embedding PUBLIC BABYLON_NATIVE_POLYFILL_SCHEDULING=1)
if(TARGET Scheduling)
target_compile_definitions(Embedding PRIVATE JSRUNTIMEHOST_POLYFILL_SCHEDULING=1)
target_link_libraries(Embedding PRIVATE Scheduling)
endif()

if(BABYLON_NATIVE_POLYFILL_URL)
target_compile_definitions(Embedding PUBLIC BABYLON_NATIVE_POLYFILL_URL=1)
if(TARGET URL)
target_compile_definitions(Embedding PRIVATE JSRUNTIMEHOST_POLYFILL_URL=1)
target_link_libraries(Embedding PRIVATE URL)
endif()

if(BABYLON_NATIVE_POLYFILL_WEBSOCKET)
target_compile_definitions(Embedding PUBLIC BABYLON_NATIVE_POLYFILL_WEBSOCKET=1)
if(TARGET WebSocket)
target_compile_definitions(Embedding PRIVATE JSRUNTIMEHOST_POLYFILL_WEBSOCKET=1)
target_link_libraries(Embedding PRIVATE WebSocket)
endif()

Expand Down
16 changes: 8 additions & 8 deletions Embedding/Source/Runtime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,19 +42,19 @@
#include <Babylon/Polyfills/TextEncoder.h>
#include <Babylon/Polyfills/XMLHttpRequest.h>

#if BABYLON_NATIVE_POLYFILL_ABORTCONTROLLER
#if JSRUNTIMEHOST_POLYFILL_ABORTCONTROLLER
#include <Babylon/Polyfills/AbortController.h>
#endif

#if BABYLON_NATIVE_POLYFILL_SCHEDULING
#if JSRUNTIMEHOST_POLYFILL_SCHEDULING
#include <Babylon/Polyfills/Scheduling.h>
#endif

#if BABYLON_NATIVE_POLYFILL_URL
#if JSRUNTIMEHOST_POLYFILL_URL
#include <Babylon/Polyfills/URL.h>
#endif

#if BABYLON_NATIVE_POLYFILL_WEBSOCKET
#if JSRUNTIMEHOST_POLYFILL_WEBSOCKET
#include <Babylon/Polyfills/WebSocket.h>
#endif

Expand Down Expand Up @@ -249,16 +249,16 @@ namespace Babylon::Embedding
Babylon::Polyfills::XMLHttpRequest::Initialize(env);
Babylon::Polyfills::Fetch::Initialize(env);

#if BABYLON_NATIVE_POLYFILL_ABORTCONTROLLER
#if JSRUNTIMEHOST_POLYFILL_ABORTCONTROLLER
Babylon::Polyfills::AbortController::Initialize(env);
#endif
#if BABYLON_NATIVE_POLYFILL_SCHEDULING
#if JSRUNTIMEHOST_POLYFILL_SCHEDULING
Babylon::Polyfills::Scheduling::Initialize(env);
#endif
#if BABYLON_NATIVE_POLYFILL_URL
#if JSRUNTIMEHOST_POLYFILL_URL
Babylon::Polyfills::URL::Initialize(env);
#endif
#if BABYLON_NATIVE_POLYFILL_WEBSOCKET
#if JSRUNTIMEHOST_POLYFILL_WEBSOCKET
Babylon::Polyfills::WebSocket::Initialize(env);
#endif

Expand Down
20 changes: 20 additions & 0 deletions Install/Install.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,11 @@ if(TARGET ShaderCompiler)
install_lib(ShaderCompiler)
endif()

if(TARGET TestUtils)
install_lib(TestUtils)
install_include(TestUtils)
endif()

if(TARGET ShaderTool)
install_bin(ShaderTool)
endif()
Expand Down Expand Up @@ -216,6 +221,16 @@ if(TARGET Console)
install_include(Console)
endif()

if(TARGET Fetch)
install_lib(Fetch)
install_include(Fetch)
endif()

if(TARGET File)
install_lib(File)
install_include(File)
endif()

if(TARGET Performance)
install_lib(Performance)
install_include(Performance)
Expand All @@ -226,6 +241,11 @@ if(TARGET TextDecoder)
install_include(TextDecoder)
endif()

if(TARGET TextEncoder)
install_lib(TextEncoder)
install_include(TextEncoder)
endif()

if(TARGET URL)
install_lib(URL)
install_include(URL)
Expand Down
14 changes: 11 additions & 3 deletions Install/Test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ foreach(LIB_NAME ${INSTALL_LIB_NAMES})
endforeach()

if(WIN32 AND NOT WINDOWS_STORE)
target_link_libraries(TestInstall
${INSTALL_LIB_NAMES}
set(INSTALL_TEST_LIBS
${INSTALL_LIBS}
gtest_main
chakrart
d3d11
Expand All @@ -105,7 +105,7 @@ else()
# The installed tree is plain archives with no CMake targets describing how they depend on
# each other, so link them as a group and let the linker resolve the cycles rather than
# depending on glob order.
target_link_libraries(TestInstall
set(INSTALL_TEST_LIBS
-Wl,--start-group ${INSTALL_LIBS} -Wl,--end-group
gtest_main
${JAVASCRIPTCORE_LIBRARY}
Expand All @@ -118,6 +118,14 @@ else()
dl)
endif()

target_link_libraries(TestInstall ${INSTALL_TEST_LIBS})

if(EXISTS "${INSTALL_LIBS_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}Embedding${CMAKE_STATIC_LIBRARY_SUFFIX}")
add_executable(TestInstallEmbedding Embedding.cpp)
target_include_directories(TestInstallEmbedding PRIVATE "${INSTALL_DIR}/include")
target_link_libraries(TestInstallEmbedding PRIVATE ${INSTALL_TEST_LIBS})
endif()

# See https://gitlab.kitware.com/cmake/cmake/-/issues/23543
# If we can set minimum required to 3.26+, then we can use the `copy -t` syntax instead.
add_custom_command(TARGET TestInstall POST_BUILD
Expand Down
Loading
Loading