Skip to content

Commit bd7a176

Browse files
Revert "Js runtime host integration (#1238)" (#1259)
This reverts commit 4ee84e3. Until JSRuntimeHost gets more stable.
1 parent f33a36c commit bd7a176

File tree

127 files changed

+27369
-37
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

127 files changed

+27369
-37
lines changed

.github/jobs/ios.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
- script: |
2828
mkdir buildiOS
2929
cd buildiOS
30-
cmake .. -G Xcode -D IOS=ON -D DEPLOYMENT_TARGET=${{ parameters.deploymentTarget }} -D CMAKE_UNITY_BUILD=${UNITY_BUILD}
30+
cmake .. -G Xcode -DCMAKE_TOOLCHAIN_FILE=../Dependencies/ios-cmake/ios.toolchain.cmake -DPLATFORM=OS64COMBINED -DENABLE_ARC=0 -DDEPLOYMENT_TARGET=${{ parameters.deploymentTarget }} -DENABLE_GLSLANG_BINARIES=OFF -DSPIRV_CROSS_CLI=OFF -DCMAKE_UNITY_BUILD=${UNITY_BUILD}
3131
displayName: 'Generate iOS solution'
3232
3333
- task: Xcode@5

.github/jobs/linux.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
- script: |
3333
mkdir build
3434
cd build
35-
cmake .. -G Ninja -D JAVASCRIPTCORE_LIBRARY=/usr/lib/x86_64-linux-gnu/libjavascriptcoregtk-4.0.so -D NAPI_JAVASCRIPT_ENGINE=${{ parameters.JSEngine }} -D CMAKE_BUILD_TYPE=RelWithDebInfo -D BGFX_CONFIG_DEBUG=ON -D CMAKE_UNITY_BUILD=${UNITY_BUILD}
35+
cmake .. -GNinja -DJSCORE_LIBRARY=/usr/lib/x86_64-linux-gnu/libjavascriptcoregtk-4.0.so -DNAPI_JAVASCRIPT_ENGINE=${{ parameters.JSEngine }} -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBGFX_CONFIG_DEBUG=ON -DCMAKE_UNITY_BUILD=${UNITY_BUILD}
3636
ninja
3737
displayName: 'Build X11'
3838

.github/jobs/macos.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
- script: |
2727
mkdir buildmacOS
2828
cd buildmacOS
29-
cmake .. -G Xcode -D CMAKE_UNITY_BUILD=${UNITY_BUILD}
29+
cmake .. -GXcode -DCMAKE_UNITY_BUILD=${UNITY_BUILD}
3030
displayName: 'Generate macOS solution'
3131
3232
- task: Xcode@5

.github/jobs/uwp.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
- script: |
3535
mkdir build${{ variables.solutionName }}
3636
cd build${{ variables.solutionName }}
37-
cmake .. -D CMAKE_SYSTEM_NAME=WindowsStore -D CMAKE_SYSTEM_VERSION=10.0 ${{ variables.jsEngineDefine }} -A ${{ parameters.platform }} -D CMAKE_UNITY_BUILD=${UNITY_BUILD}
37+
cmake .. -DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION=10.0 ${{ variables.jsEngineDefine }} -A ${{ parameters.platform }} -DCMAKE_UNITY_BUILD=${UNITY_BUILD}
3838
displayName: 'Generate ${{ variables.solutionName }} solution'
3939
4040
- task: VSBuild@1

.github/jobs/win32.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
- script: |
3838
mkdir build${{ variables.solutionName }}
3939
cd build${{ variables.solutionName }}
40-
cmake -A ${{ parameters.platform }} ${{ variables.jsEngineDefine }} -D BGFX_CONFIG_DEBUG=ON -D GRAPHICS_API=${{ parameters.graphics_api }} -D CMAKE_UNITY_BUILD=${UNITY_BUILD} ..
40+
cmake -A ${{ parameters.platform }} ${{ variables.jsEngineDefine }} -DBGFX_CONFIG_DEBUG=ON -DGRAPHICS_API=${{ parameters.graphics_api }} -DCMAKE_UNITY_BUILD=${UNITY_BUILD} ..
4141
displayName: 'Generate ${{ variables.solutionName }} solution'
4242
4343
- task: MSBuild@1

.gitmodules

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
[submodule "base-n"]
22
path = Dependencies/base-n
33
url = https://github.com/azawadzki/base-n
4+
[submodule "arcana.cpp"]
5+
path = Dependencies/arcana.cpp
6+
url = https://github.com/microsoft/arcana.cpp
47
[submodule "glslang"]
58
path = Dependencies/glslang
69
url = https://github.com/KhronosGroup/glslang
@@ -10,6 +13,9 @@
1013
[submodule "bgfx.cmake"]
1114
path = Dependencies/bgfx.cmake
1215
url = https://github.com/BabylonJS/bgfx.cmake
16+
[submodule "Dependencies/ios-cmake"]
17+
path = Dependencies/ios-cmake
18+
url = https://github.com/leetal/ios-cmake.git
1319
[submodule "Dependencies/xr/Dependencies/OpenXR-SDK"]
1420
path = Dependencies/xr/Dependencies/OpenXR-SDK
1521
url = https://github.com/KhronosGroup/OpenXR-SDK

Apps/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ if((WIN32 AND NOT WINDOWS_STORE) OR (APPLE AND NOT IOS) OR (UNIX AND NOT ANDROID
77
endif()
88

99
# NPM install
10-
npm(install ${CMAKE_CURRENT_SOURCE_DIR} "Apps module")
10+
npm(install)

Apps/Playground/Android/app/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ target_link_libraries(BabylonNativeJNI
5656
AppRuntime
5757
Canvas
5858
Console
59+
ChromeDevTools
5960
GraphicsDevice
6061
NativeCamera
6162
NativeEngine

Apps/Playground/Android/app/src/main/cpp/BabylonNativeJNI.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include <Babylon/Plugins/NativeXr.h>
1919
#include <Babylon/Plugins/NativeCamera.h>
2020
#include <Babylon/Plugins/NativeOptimizations.h>
21+
#include <Babylon/Plugins/ChromeDevTools.h>
2122
#include <Babylon/Polyfills/Console.h>
2223
#include <Babylon/Polyfills/Window.h>
2324
#include <Babylon/Polyfills/XMLHttpRequest.h>
@@ -28,6 +29,7 @@ namespace
2829
std::optional<Babylon::Graphics::Device> device{};
2930
std::optional<Babylon::Graphics::DeviceUpdate> deviceUpdate{};
3031
std::optional<Babylon::AppRuntime> runtime{};
32+
std::optional<Babylon::Plugins::ChromeDevTools> chromeDevTools{};
3133
std::optional<Babylon::Plugins::NativeXr> nativeXr{};
3234
Babylon::Plugins::NativeInput* nativeInput{};
3335
std::optional<Babylon::Polyfills::Canvas> nativeCanvas{};
@@ -56,6 +58,7 @@ extern "C"
5658
scriptLoader.reset();
5759

5860
nativeInput = {};
61+
chromeDevTools.reset();
5962
nativeXr.reset();
6063
scriptLoader.reset();
6164
runtime.reset();
@@ -123,6 +126,12 @@ extern "C"
123126

124127
Babylon::Polyfills::XMLHttpRequest::Initialize(env);
125128
nativeCanvas.emplace(Babylon::Polyfills::Canvas::Initialize(env));
129+
130+
chromeDevTools.emplace(Babylon::Plugins::ChromeDevTools::Initialize(env));
131+
if (chromeDevTools->SupportsInspector())
132+
{
133+
chromeDevTools->StartInspector(5643, "BabylonNative Playground");
134+
}
126135
});
127136

128137
scriptLoader.emplace(*runtime);

Apps/Playground/CMakeLists.txt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ set(SCRIPTS
2222
"Scripts/config.json")
2323

2424
if(APPLE)
25-
find_library(JAVASCRIPTCORE_LIBRARY JavaScriptCore)
25+
find_library(JSCORE_LIBRARY JavaScriptCore)
2626
if(IOS)
2727
set(PLIST_FILE
2828
"${CMAKE_CURRENT_LIST_DIR}/iOS/Info.plist")
@@ -54,7 +54,7 @@ if(APPLE)
5454
set_source_files_properties(${REFERENCE_IMAGES} PROPERTIES MACOSX_PACKAGE_LOCATION "Resources/ReferenceImages")
5555
endif()
5656
set(ADDITIONAL_LIBRARIES ${ADDITIONAL_LIBRARIES}
57-
PRIVATE ${JAVASCRIPTCORE_LIBRARY}
57+
PRIVATE ${JSCORE_LIBRARY}
5858
PRIVATE NativeCamera)
5959
set(RESOURCE_FILES ${STORYBOARD})
6060
elseif(UNIX)
@@ -115,6 +115,7 @@ target_include_directories(Playground PRIVATE "Source" ".")
115115
target_link_to_dependencies(Playground
116116
PRIVATE AppRuntime
117117
PRIVATE Canvas
118+
PRIVATE ChromeDevTools
118119
PRIVATE Console
119120
PRIVATE GraphicsDevice
120121
PRIVATE NativeCapture
@@ -128,10 +129,10 @@ target_link_to_dependencies(Playground
128129
${ADDITIONAL_LIBRARIES}
129130
${BABYLON_NATIVE_PLAYGROUND_EXTENSION_LIBRARIES})
130131

131-
# See https://gitlab.kitware.com/cmake/cmake/-/issues/23543
132-
# If we can set minimum required to 3.26+, then we can use the `copy -t` syntax instead.
133-
add_custom_command(TARGET Playground POST_BUILD
134-
COMMAND ${CMAKE_COMMAND} -E $<IF:$<BOOL:$<TARGET_RUNTIME_DLLS:Playground>>,copy,true> $<TARGET_RUNTIME_DLLS:Playground> $<TARGET_FILE_DIR:Playground>)
132+
if(WIN32)
133+
target_link_to_dependencies(Playground
134+
PRIVATE "shlwapi.lib")
135+
endif()
135136

136137
if (UNIX AND NOT APPLE AND NOT ANDROID)
137138
# Ubuntu mixes old experimental header and new runtime libraries
@@ -175,7 +176,6 @@ if(APPLE)
175176
RESOURCE "${RESOURCE_FILES}"
176177
FOLDER "Playground")
177178
endif()
178-
set_property(TARGET Playground PROPERTY UNITY_BUILD false)
179179
endif()
180180

181181
if(WINDOWS_STORE)

0 commit comments

Comments
 (0)