@babylonjs/react-native 1.9.1-preview → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/postinstall.js +20 -5
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@babylonjs/react-native",
|
|
3
3
|
"title": "React Native Babylon",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "2.0.0",
|
|
5
5
|
"description": "Babylon Native integration into React Native",
|
|
6
6
|
"main": "index.js",
|
|
7
7
|
"scripts": {
|
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
"readmeFilename": "README.md",
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"base-64": "^0.1.0",
|
|
29
|
+
"cmake-runtime": "3.31.0",
|
|
29
30
|
"semver": "^7.3.2"
|
|
30
31
|
},
|
|
31
32
|
"peerDependencies": {
|
|
@@ -35,7 +36,6 @@
|
|
|
35
36
|
"react-native-permissions": ">=3.0.0"
|
|
36
37
|
},
|
|
37
38
|
"devDependencies": {
|
|
38
|
-
"cmake-runtime": "3.31.0",
|
|
39
39
|
"@babel/core": "^7.8.4",
|
|
40
40
|
"@babel/runtime": "^7.8.4",
|
|
41
41
|
"@babylonjs/core": ">=5.53.1",
|
package/postinstall.js
CHANGED
|
@@ -1,14 +1,29 @@
|
|
|
1
1
|
const os = require("os");
|
|
2
|
+
const path = require("path");
|
|
3
|
+
|
|
4
|
+
function getCmakeExecutable() {
|
|
5
|
+
try {
|
|
6
|
+
// cmake-runtime ships the cmake binary; resolve it directly to avoid
|
|
7
|
+
// relying on npx or PATH.
|
|
8
|
+
const pkgDir = path.dirname(require.resolve('cmake-runtime/package.json'));
|
|
9
|
+
const pkg = require('cmake-runtime/package.json');
|
|
10
|
+
// cmake-runtime exposes the binary path via its "bin" field
|
|
11
|
+
const binRelative = typeof pkg.bin === 'string' ? pkg.bin : pkg.bin['cmake'];
|
|
12
|
+
return path.join(pkgDir, binRelative);
|
|
13
|
+
} catch (e) {
|
|
14
|
+
// Fall back to a cmake on PATH (e.g. homebrew or system install)
|
|
15
|
+
return 'cmake';
|
|
16
|
+
}
|
|
17
|
+
}
|
|
2
18
|
|
|
3
19
|
function iosCMake() {
|
|
4
20
|
const { spawn } = require('child_process');
|
|
5
21
|
|
|
6
|
-
const cmake = spawn(
|
|
7
|
-
'
|
|
8
|
-
'-
|
|
9
|
-
'-B', 'Build/iOS',
|
|
22
|
+
const cmake = spawn(getCmakeExecutable(), [
|
|
23
|
+
'-S', path.join(__dirname, 'ios'),
|
|
24
|
+
'-B', path.join(__dirname, 'Build/iOS'),
|
|
10
25
|
'-G', 'Xcode',
|
|
11
|
-
], { stdio: 'inherit' });
|
|
26
|
+
], { stdio: 'inherit', cwd: __dirname });
|
|
12
27
|
|
|
13
28
|
cmake.on('exit', code => {
|
|
14
29
|
if (code !== 0) {
|