diff --git a/CMakeLists.txt b/CMakeLists.txt index f98f5aeed..4e662543c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -37,7 +37,7 @@ FetchContent_Declare(ios-cmake GIT_TAG 4.4.1) FetchContent_Declare(JsRuntimeHost GIT_REPOSITORY https://github.com/BabylonJS/JsRuntimeHost.git - GIT_TAG ef3bb85d2e8e1ec314aaa2ff0df7fba360acd1b1) + GIT_TAG 66c863be8cedf2869a4e59ce99144417c78af73c) FetchContent_Declare(OpenXR-MixedReality GIT_REPOSITORY https://github.com/microsoft/OpenXR-MixedReality.git GIT_TAG 67424511525b96a36847f2a96d689d99e5879503) diff --git a/Install/Install.cmake b/Install/Install.cmake index 19b18bb02..6239096ac 100644 --- a/Install/Install.cmake +++ b/Install/Install.cmake @@ -63,6 +63,8 @@ install_targets(UrlLib) # ---------------- # Core # ---------------- +install_include_for_targets(Foundation) + install_targets(JsRuntime) install_include_for_targets(JsRuntime) diff --git a/Plugins/NativeCamera/Include/Babylon/Plugins/NativeCamera.h b/Plugins/NativeCamera/Include/Babylon/Plugins/NativeCamera.h index 2b9217f97..765d5ce68 100644 --- a/Plugins/NativeCamera/Include/Babylon/Plugins/NativeCamera.h +++ b/Plugins/NativeCamera/Include/Babylon/Plugins/NativeCamera.h @@ -1,8 +1,9 @@ #pragma once #include +#include namespace Babylon::Plugins::NativeCamera { - void Initialize(Napi::Env env); + void BABYLON_API Initialize(Napi::Env env); } diff --git a/Plugins/NativeCamera/Source/NativeCamera.cpp b/Plugins/NativeCamera/Source/NativeCamera.cpp index fb654c86f..da9da32ba 100644 --- a/Plugins/NativeCamera/Source/NativeCamera.cpp +++ b/Plugins/NativeCamera/Source/NativeCamera.cpp @@ -48,7 +48,7 @@ namespace Babylon::Plugins::Internal namespace Babylon::Plugins::NativeCamera { - void Initialize(Napi::Env env) + void BABYLON_API Initialize(Napi::Env env) { Babylon::Plugins::NativeVideo::Initialize(env); Babylon::Plugins::MediaDevices::Initialize(env); diff --git a/Plugins/NativeCapture/Include/Babylon/Plugins/NativeCapture.h b/Plugins/NativeCapture/Include/Babylon/Plugins/NativeCapture.h index 73ce9a776..b4a09065d 100644 --- a/Plugins/NativeCapture/Include/Babylon/Plugins/NativeCapture.h +++ b/Plugins/NativeCapture/Include/Babylon/Plugins/NativeCapture.h @@ -1,8 +1,9 @@ #pragma once #include +#include namespace Babylon::Plugins::NativeCapture { - void Initialize(Napi::Env env); + void BABYLON_API Initialize(Napi::Env env); } diff --git a/Plugins/NativeCapture/Source/NativeCapture.cpp b/Plugins/NativeCapture/Source/NativeCapture.cpp index 32719ca6d..0fee30fff 100644 --- a/Plugins/NativeCapture/Source/NativeCapture.cpp +++ b/Plugins/NativeCapture/Source/NativeCapture.cpp @@ -256,7 +256,7 @@ namespace Babylon::Plugins::Internal namespace Babylon::Plugins::NativeCapture { - void Initialize(Napi::Env env) + void BABYLON_API Initialize(Napi::Env env) { Babylon::Plugins::Internal::NativeCapture::Initialize(env); } diff --git a/Plugins/NativeEngine/Include/Babylon/Plugins/NativeEngine.h b/Plugins/NativeEngine/Include/Babylon/Plugins/NativeEngine.h index c65fb6a53..cae80be2e 100644 --- a/Plugins/NativeEngine/Include/Babylon/Plugins/NativeEngine.h +++ b/Plugins/NativeEngine/Include/Babylon/Plugins/NativeEngine.h @@ -1,8 +1,9 @@ #pragma once #include +#include namespace Babylon::Plugins::NativeEngine { - void Initialize(Napi::Env env); + void BABYLON_API Initialize(Napi::Env env); } diff --git a/Plugins/NativeEngine/Source/NativeEngine.cpp b/Plugins/NativeEngine/Source/NativeEngine.cpp index 20a4ffe4d..f8d5d6450 100644 --- a/Plugins/NativeEngine/Source/NativeEngine.cpp +++ b/Plugins/NativeEngine/Source/NativeEngine.cpp @@ -400,7 +400,7 @@ namespace Babylon using CommandFunctionPointerT = void (NativeEngine::*)(NativeDataStream::Reader&); } - void NativeEngine::Initialize(Napi::Env env) + void BABYLON_API NativeEngine::Initialize(Napi::Env env) { // Initialize the JavaScript side. Napi::HandleScope scope{env}; diff --git a/Plugins/NativeInput/Include/Babylon/Plugins/NativeInput.h b/Plugins/NativeInput/Include/Babylon/Plugins/NativeInput.h index e69306c6c..815db687d 100644 --- a/Plugins/NativeInput/Include/Babylon/Plugins/NativeInput.h +++ b/Plugins/NativeInput/Include/Babylon/Plugins/NativeInput.h @@ -1,6 +1,7 @@ #pragma once #include +#include namespace Babylon::Plugins { @@ -9,8 +10,8 @@ namespace Babylon::Plugins public: // TODO: Ideally instances of these should be scoped to individual views within an env, but we don't yet support multi-view. // See https://github.com/BabylonJS/BabylonNative/issues/147 - static NativeInput& CreateForJavaScript(Napi::Env); - static NativeInput& GetFromJavaScript(Napi::Env); + static NativeInput& BABYLON_API CreateForJavaScript(Napi::Env); + static NativeInput& BABYLON_API GetFromJavaScript(Napi::Env); void MouseDown(uint32_t buttonIndex, int32_t x, int32_t y); void MouseUp(uint32_t buttonIndex, int32_t x, int32_t y); diff --git a/Plugins/NativeInput/Source/Shared/NativeInput.cpp b/Plugins/NativeInput/Source/Shared/NativeInput.cpp index 026efb85b..23f004dd6 100644 --- a/Plugins/NativeInput/Source/Shared/NativeInput.cpp +++ b/Plugins/NativeInput/Source/Shared/NativeInput.cpp @@ -42,13 +42,13 @@ namespace Babylon::Plugins env.Global().Set(JS_NATIVE_INPUT_NAME, nativeInput); } - NativeInput& NativeInput::CreateForJavaScript(Napi::Env env) + NativeInput& BABYLON_API NativeInput::CreateForJavaScript(Napi::Env env) { auto* nativeInput = new NativeInput(env); return *nativeInput; } - NativeInput& NativeInput::GetFromJavaScript(Napi::Env env) + NativeInput& BABYLON_API NativeInput::GetFromJavaScript(Napi::Env env) { return *env.Global().Get(JS_NATIVE_INPUT_NAME).As>().Data(); } diff --git a/Plugins/NativeOptimizations/Include/Babylon/Plugins/NativeOptimizations.h b/Plugins/NativeOptimizations/Include/Babylon/Plugins/NativeOptimizations.h index 35ca0236d..9c42636a4 100644 --- a/Plugins/NativeOptimizations/Include/Babylon/Plugins/NativeOptimizations.h +++ b/Plugins/NativeOptimizations/Include/Babylon/Plugins/NativeOptimizations.h @@ -1,8 +1,9 @@ #pragma once #include +#include namespace Babylon::Plugins::NativeOptimizations { - void Initialize(Napi::Env env); + void BABYLON_API Initialize(Napi::Env env); } diff --git a/Plugins/NativeOptimizations/Source/NativeOptimizations.cpp b/Plugins/NativeOptimizations/Source/NativeOptimizations.cpp index 8c6fa9a11..81bbe5cf0 100644 --- a/Plugins/NativeOptimizations/Source/NativeOptimizations.cpp +++ b/Plugins/NativeOptimizations/Source/NativeOptimizations.cpp @@ -197,7 +197,7 @@ namespace namespace Babylon::Plugins::NativeOptimizations { - void Initialize(Napi::Env env) + void BABYLON_API Initialize(Napi::Env env) { auto nativeObject{JsRuntime::NativeObject::GetFromJavaScript(env)}; nativeObject.Set("_TransformVector3Coordinates", Napi::Function::New(env, TransformVector3Coordinates, "_TransformVector3Coordinates")); diff --git a/Plugins/NativeTracing/Include/Babylon/Plugins/NativeTracing.h b/Plugins/NativeTracing/Include/Babylon/Plugins/NativeTracing.h index 77dd33feb..feeb25663 100644 --- a/Plugins/NativeTracing/Include/Babylon/Plugins/NativeTracing.h +++ b/Plugins/NativeTracing/Include/Babylon/Plugins/NativeTracing.h @@ -1,8 +1,9 @@ #pragma once #include +#include namespace Babylon::Plugins::NativeTracing { - void Initialize(Napi::Env env); + void BABYLON_API Initialize(Napi::Env env); } diff --git a/Plugins/NativeTracing/Source/NativeTracing.cpp b/Plugins/NativeTracing/Source/NativeTracing.cpp index 33e7baea2..c10668b06 100644 --- a/Plugins/NativeTracing/Source/NativeTracing.cpp +++ b/Plugins/NativeTracing/Source/NativeTracing.cpp @@ -31,7 +31,7 @@ namespace namespace Babylon::Plugins::NativeTracing { - void Initialize(Napi::Env env) + void BABYLON_API Initialize(Napi::Env env) { auto nativeObject{JsRuntime::NativeObject::GetFromJavaScript(env)}; nativeObject.Set("startPerformanceCounter", Napi::Function::New(env, StartPerformanceCounter, "startPerformanceCounter")); diff --git a/Plugins/NativeXr/Include/Babylon/Plugins/NativeXr.h b/Plugins/NativeXr/Include/Babylon/Plugins/NativeXr.h index c0a882e8d..15c35aba3 100644 --- a/Plugins/NativeXr/Include/Babylon/Plugins/NativeXr.h +++ b/Plugins/NativeXr/Include/Babylon/Plugins/NativeXr.h @@ -1,6 +1,7 @@ #pragma once #include +#include namespace Babylon::Plugins { @@ -17,7 +18,7 @@ namespace Babylon::Plugins ~NativeXr(); - static NativeXr Initialize(Napi::Env env); + static NativeXr BABYLON_API Initialize(Napi::Env env); void UpdateWindow(void* windowPtr); void SetSessionStateChangedCallback(std::function callback); diff --git a/Plugins/NativeXr/Source/NativeXr.cpp b/Plugins/NativeXr/Source/NativeXr.cpp index b732fbfda..5e6592fc0 100644 --- a/Plugins/NativeXr/Source/NativeXr.cpp +++ b/Plugins/NativeXr/Source/NativeXr.cpp @@ -3517,7 +3517,7 @@ namespace Babylon { } - NativeXr NativeXr::Initialize(Napi::Env env) + NativeXr BABYLON_API NativeXr::Initialize(Napi::Env env) { auto impl{std::make_shared(env)}; diff --git a/Plugins/TestUtils/Include/Babylon/Plugins/TestUtils.h b/Plugins/TestUtils/Include/Babylon/Plugins/TestUtils.h index 23c367c71..7f4499bed 100644 --- a/Plugins/TestUtils/Include/Babylon/Plugins/TestUtils.h +++ b/Plugins/TestUtils/Include/Babylon/Plugins/TestUtils.h @@ -6,5 +6,5 @@ namespace Babylon::Plugins::TestUtils { extern int errorCode; - void Initialize(Napi::Env env, Graphics::WindowT window); + void BABYLON_API Initialize(Napi::Env env, Graphics::WindowT window); } diff --git a/Plugins/TestUtils/Source/Win32/TestUtilsImpl.cpp b/Plugins/TestUtils/Source/Win32/TestUtilsImpl.cpp index fdde753b5..70ed42a76 100644 --- a/Plugins/TestUtils/Source/Win32/TestUtilsImpl.cpp +++ b/Plugins/TestUtils/Source/Win32/TestUtilsImpl.cpp @@ -52,7 +52,7 @@ namespace Babylon::Plugins::Internal namespace Babylon::Plugins::TestUtils { - void Initialize(Napi::Env env, Graphics::WindowT window) + void BABYLON_API Initialize(Napi::Env env, Graphics::WindowT window) { auto implData{std::make_shared(window)}; Internal::TestUtils::CreateInstance(env, implData); diff --git a/Plugins/TestUtils/Source/WinRT/TestUtilsImpl.cpp b/Plugins/TestUtils/Source/WinRT/TestUtilsImpl.cpp index a853b9072..876c9de45 100644 --- a/Plugins/TestUtils/Source/WinRT/TestUtilsImpl.cpp +++ b/Plugins/TestUtils/Source/WinRT/TestUtilsImpl.cpp @@ -27,7 +27,7 @@ namespace Babylon::Plugins::Internal namespace Babylon::Plugins::TestUtils { - void Initialize(Napi::Env env, Graphics::WindowT window) + void BABYLON_API Initialize(Napi::Env env, Graphics::WindowT window) { auto implData{std::make_shared(window)}; Internal::TestUtils::CreateInstance(env, implData); diff --git a/Polyfills/Canvas/Include/Babylon/Polyfills/Canvas.h b/Polyfills/Canvas/Include/Babylon/Polyfills/Canvas.h index 5687039a2..443e336d6 100644 --- a/Polyfills/Canvas/Include/Babylon/Polyfills/Canvas.h +++ b/Polyfills/Canvas/Include/Babylon/Polyfills/Canvas.h @@ -1,6 +1,7 @@ #pragma once #include +#include namespace Babylon::Polyfills { @@ -20,7 +21,7 @@ namespace Babylon::Polyfills // This instance must live as long as the JS Runtime. // If JSRuntime is attached/detached (BabylonReactNative), // then this instance must live forever. - [[nodiscard]] static Canvas Initialize(Napi::Env env); + [[nodiscard]] static Canvas BABYLON_API Initialize(Napi::Env env); void FlushGraphicResources(); diff --git a/Polyfills/Canvas/Source/Canvas.cpp b/Polyfills/Canvas/Source/Canvas.cpp index 44afb2e6e..b84d8bf27 100644 --- a/Polyfills/Canvas/Source/Canvas.cpp +++ b/Polyfills/Canvas/Source/Canvas.cpp @@ -229,7 +229,7 @@ namespace Babylon::Polyfills { } - Canvas Canvas::Initialize(Napi::Env env) + Canvas BABYLON_API Canvas::Initialize(Napi::Env env) { auto impl{std::make_shared(env)}; diff --git a/Polyfills/Window/Include/Babylon/Polyfills/Window.h b/Polyfills/Window/Include/Babylon/Polyfills/Window.h index d9e32d930..32294798c 100644 --- a/Polyfills/Window/Include/Babylon/Polyfills/Window.h +++ b/Polyfills/Window/Include/Babylon/Polyfills/Window.h @@ -1,8 +1,9 @@ #pragma once #include +#include namespace Babylon::Polyfills::Window { - void Initialize(Napi::Env env); + void BABYLON_API Initialize(Napi::Env env); } diff --git a/Polyfills/Window/Source/Window.cpp b/Polyfills/Window/Source/Window.cpp index 76788b225..02de9586e 100644 --- a/Polyfills/Window/Source/Window.cpp +++ b/Polyfills/Window/Source/Window.cpp @@ -125,7 +125,7 @@ namespace Babylon::Polyfills::Internal namespace Babylon::Polyfills::Window { - void Initialize(Napi::Env env) + void BABYLON_API Initialize(Napi::Env env) { Internal::Window::Initialize(env); }