Skip to content

Commit 9542c30

Browse files
Fix Xcode 26 build: suppress deprecated-declarations + BABYLON_USE_SYSTEM_CMAKE env var (#726)
* Fix Xcode 26 build: suppress deprecated-declarations for Clang targets wstring_convert<codecvt_utf8_utf16> is deprecated in C++17 and the BabylonNative cmakeextensions build helper adds -Werror to all Clang targets, turning this deprecation into a hard build error on Xcode 26+ / Clang 20+. Add -Wno-deprecated-declarations via add_compile_options for Clang/ AppleClang builds so the project compiles cleanly while all other -Werror checks remain enforced. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Add BABYLON_USE_SYSTEM_CMAKE env var and update version table - postinstall.js: add BABYLON_USE_SYSTEM_CMAKE=1 env variable that bypasses the npm-bundled cmake-runtime package and uses whatever cmake is found on PATH (Homebrew, system install, etc.) - README: document the new BABYLON_USE_SYSTEM_CMAKE variable in the iOS CMake configuration section - README: add BabylonReactNative 2.0.2 entry to the Platform Native Packages version table (requires Babylon.js 9.0.0, BabylonNative 887a044) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Update BabylonNative to ce2edf08 and fix README commit hash format - Package/gulpfile.js: update COMMIT_ID to latest BabylonNative master commit ce2edf0851e0c8483559832a4f8eb9d39c6b2f53 - README.md: use full 40-character commit hash for the 2.0.2 row to match the format of existing rows in the Platform Native Packages table Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 15ae894 commit 9542c30

File tree

4 files changed

+18
-1
lines changed

4 files changed

+18
-1
lines changed

Modules/@babylonjs/react-native/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ To disable post install CMake generation, set this variable before running `npm
3434
export BABYLON_NO_CMAKE_POSTINSTALL=1
3535
```
3636

37+
To use the system cmake (e.g. a Homebrew or system install) instead of the cmake bundled in the npm package, set this variable before running `npm install`:
38+
```
39+
export BABYLON_USE_SYSTEM_CMAKE=1
40+
```
41+
3742
### Plugins selection
3843

3944
Plugins can be disabled at build time. They are all enabled by default and disabling is done with environment variables:
@@ -56,6 +61,7 @@ Babylon.js minimal version:
5661

5762
|BabylonReactNative version | Babylon.js version | BabylonNative commit |
5863
| ----------- | ------------------------ | --- |
64+
|2.0.2 | 9.0.0 | ce2edf0851e0c8483559832a4f8eb9d39c6b2f53
5965
|2.0.0 | 8.3.0 | 6c25966e8f8c0f3a0c13fdf77064f1bde790391f
6066

6167

Modules/@babylonjs/react-native/ios/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall")
1919
set(CMAKE_CXX_STANDARD 17)
2020
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -x objective-c++")
2121

22+
# wstring_convert and codecvt_utf8_utf16 are deprecated in C++17; prevent this from
23+
# being treated as a hard error so the build succeeds on Xcode 26+ / Clang 20+.
24+
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
25+
add_compile_options(-Wno-deprecated-declarations)
26+
endif()
27+
2228
set(BABYLON_NATIVE_PLUGIN_NATIVEXR 1)
2329
if(DEFINED ENV{BABYLON_NATIVE_PLUGIN_NATIVEXR})
2430
set(BABYLON_NATIVE_PLUGIN_NATIVEXR $ENV{BABYLON_NATIVE_PLUGIN_NATIVEXR})

Modules/@babylonjs/react-native/postinstall.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@ const os = require("os");
22
const path = require("path");
33

44
function getCmakeExecutable() {
5+
// When BABYLON_USE_SYSTEM_CMAKE=1, skip the npm cmake package and use whatever
6+
// cmake is found on PATH (e.g. a Homebrew or system install).
7+
if (process.env.BABYLON_USE_SYSTEM_CMAKE === '1') {
8+
return 'cmake';
9+
}
510
try {
611
// cmake-runtime ships the cmake binary; resolve it directly to avoid
712
// relying on npx or PATH.

Package/gulpfile.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ const createPackage = async () => {
230230
exec('npm pack', 'Assembled');
231231
};
232232

233-
const COMMIT_ID = '887a0446c2ce5d379d931d802071cf6f9e008c6a';
233+
const COMMIT_ID = 'ce2edf0851e0c8483559832a4f8eb9d39c6b2f53';
234234
const ZIP_URL = `https://github.com/BabylonJS/BabylonNative/archive/${COMMIT_ID}.zip`;
235235
const TARGET_DIR = path.resolve(__dirname, '../Modules/@babylonjs/react-native/shared/BabylonNative');
236236
const ZIP_PATH = path.join(TARGET_DIR, `${COMMIT_ID}.zip`);

0 commit comments

Comments
 (0)