Skip to content

More robust cmake usage iOS#695

Merged
CedricGuillemet merged 1 commit into
BabylonJS:masterfrom
CedricGuillemet:CMakeiOS
Feb 24, 2026
Merged

More robust cmake usage iOS#695
CedricGuillemet merged 1 commit into
BabylonJS:masterfrom
CedricGuillemet:CMakeiOS

Conversation

@CedricGuillemet
Copy link
Copy Markdown
Collaborator

No description provided.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread Modules/@babylonjs/react-native/postinstall.js
Comment thread Modules/@babylonjs/react-native/postinstall.js
Comment thread Modules/@babylonjs/react-native/postinstall.js
@ryantrem
Copy link
Copy Markdown
Member

Why is manually finding the bin path more robust than using npx or npm exec?

@CedricGuillemet
Copy link
Copy Markdown
Collaborator Author

Why is manually finding the bin path more robust than using npx or npm exec?

I keep getting an error locally "could not determine executable to run". I couldn't find any other solution than that.

@ryantrem
Copy link
Copy Markdown
Member

Why is manually finding the bin path more robust than using npx or npm exec?

I keep getting an error locally "could not determine executable to run". I couldn't find any other solution than that.

For both npx and npm exec?

@CedricGuillemet
Copy link
Copy Markdown
Collaborator Author

Why is manually finding the bin path more robust than using npx or npm exec?

I keep getting an error locally "could not determine executable to run". I couldn't find any other solution than that.

For both npx and npm exec?

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.

@CedricGuillemet CedricGuillemet merged commit 1c18ec0 into BabylonJS:master Feb 24, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants