diff --git a/Apps/UnitTests/JavaScript/dist/tests.javaScript.all.js b/Apps/UnitTests/JavaScript/dist/tests.javaScript.all.js index 58440130cf..5d5828f1b4 100644 --- a/Apps/UnitTests/JavaScript/dist/tests.javaScript.all.js +++ b/Apps/UnitTests/JavaScript/dist/tests.javaScript.all.js @@ -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] }, @@ -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, @@ -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;} @@ -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]]);})) diff --git a/Apps/UnitTests/JavaScript/src/tests.nativeEngine.png.ts b/Apps/UnitTests/JavaScript/src/tests.nativeEngine.png.ts index 3384851096..7fcdd04f42 100644 --- a/Apps/UnitTests/JavaScript/src/tests.nativeEngine.png.ts +++ b/Apps/UnitTests/JavaScript/src/tests.nativeEngine.png.ts @@ -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], }, @@ -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, @@ -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) { @@ -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(); } diff --git a/BUILDING.md b/BUILDING.md index 92f72887c9..c185cb7493 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -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_` 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_` settings. + ## Selecting the Graphics API For Win32, UWP, Android, and Linux, it's possible to build for different graphics API. diff --git a/CMakeLists.txt b/CMakeLists.txt index b3823052e7..9dc5c51807 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 @@ -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 @@ -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) @@ -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 diff --git a/Dependencies/CMakeLists.txt b/Dependencies/CMakeLists.txt index a6cdae9531..29dae77122 100644 --- a/Dependencies/CMakeLists.txt +++ b/Dependencies/CMakeLists.txt @@ -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) @@ -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}) diff --git a/Documentation/BuildSystem.md b/Documentation/BuildSystem.md index 55ec769c9e..dea046a749 100644 --- a/Documentation/BuildSystem.md +++ b/Documentation/BuildSystem.md @@ -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. diff --git a/Embedding/CMakeLists.txt b/Embedding/CMakeLists.txt index b2f7047263..5df8bcb33d 100644 --- a/Embedding/CMakeLists.txt +++ b/Embedding/CMakeLists.txt @@ -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) @@ -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() diff --git a/Embedding/Source/Runtime.cpp b/Embedding/Source/Runtime.cpp index c279458182..cc70ba2139 100644 --- a/Embedding/Source/Runtime.cpp +++ b/Embedding/Source/Runtime.cpp @@ -42,19 +42,19 @@ #include #include -#if BABYLON_NATIVE_POLYFILL_ABORTCONTROLLER +#if JSRUNTIMEHOST_POLYFILL_ABORTCONTROLLER #include #endif -#if BABYLON_NATIVE_POLYFILL_SCHEDULING +#if JSRUNTIMEHOST_POLYFILL_SCHEDULING #include #endif -#if BABYLON_NATIVE_POLYFILL_URL +#if JSRUNTIMEHOST_POLYFILL_URL #include #endif -#if BABYLON_NATIVE_POLYFILL_WEBSOCKET +#if JSRUNTIMEHOST_POLYFILL_WEBSOCKET #include #endif @@ -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 diff --git a/Install/Install.cmake b/Install/Install.cmake index 16efea0eab..287fc842be 100644 --- a/Install/Install.cmake +++ b/Install/Install.cmake @@ -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() @@ -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) @@ -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) diff --git a/Install/Test/CMakeLists.txt b/Install/Test/CMakeLists.txt index c77d6a009b..c0bd87ee91 100644 --- a/Install/Test/CMakeLists.txt +++ b/Install/Test/CMakeLists.txt @@ -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 @@ -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} @@ -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 diff --git a/Install/Test/Embedding.cpp b/Install/Test/Embedding.cpp new file mode 100644 index 0000000000..c6d06ea082 --- /dev/null +++ b/Install/Test/Embedding.cpp @@ -0,0 +1,7 @@ +#include + +int main() +{ + Babylon::Embedding::Runtime runtime{}; + return runtime.IsSuspended() ? 1 : 0; +} diff --git a/Polyfills/Window/CMakeLists.txt b/Polyfills/Window/CMakeLists.txt index 42afacaddd..d87b4354b9 100644 --- a/Polyfills/Window/CMakeLists.txt +++ b/Polyfills/Window/CMakeLists.txt @@ -1,3 +1,7 @@ +if(NOT TARGET Scheduling) + message(FATAL_ERROR "The Window polyfill requires Scheduling. Enable JSRUNTIMEHOST_POLYFILL_SCHEDULING or disable BABYLON_NATIVE_POLYFILL_WINDOW.") +endif() + set(SOURCES "Include/Babylon/Polyfills/Window.h" "Source/Window.h"