More robust cmake usage iOS#695
Conversation
There was a problem hiding this comment.
Pull request overview
This PR improves the robustness of CMake usage for iOS builds in the Babylon React Native package. The changes eliminate the dependency on npx and PATH-based cmake resolution by directly resolving the cmake binary from the cmake-runtime package, and add explicit path handling using __dirname.
Changes:
- Added getCmakeExecutable() function to resolve cmake binary directly from cmake-runtime package with fallback to system cmake
- Updated iosCMake() to use absolute paths with __dirname instead of relative paths
- Moved cmake-runtime from devDependencies to dependencies to ensure availability at runtime
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| Modules/@babylonjs/react-native/postinstall.js | Added getCmakeExecutable() function and updated iosCMake() to use absolute paths and direct cmake resolution |
| Modules/@babylonjs/react-native/package.json | Moved cmake-runtime from devDependencies to dependencies |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Why is manually finding the bin path more robust than using |
I keep getting an error locally "could not determine executable to run". I couldn't find any other solution than that. |
For both |
yes. Everything seems correct with valid files in bin folder but none of npx or npm exec worked reliably. It must be possible because it works on CI. At least in some cases. |
No description provided.