Skip to content

Fall back to Unix Makefiles when Ninja is missing - #108

Merged
kraenhansen merged 1 commit into
mainfrom
kh/ninja-makefile-fallback
Oct 31, 2026
Merged

kraenhansen merged 1 commit into
mainfrom
kh/ninja-makefile-fallback

Conversation

@kraenhansen

@kraenhansen kraenhansen commented May 22, 2025 •

Copy link
Copy Markdown
Collaborator

Fixes #95.

Android builds no longer require Ninja: cmake-rn falls back to Unix Makefiles when it isn't installed, and logs a note. CMAKE_MAKE_PROGRAM=ninja is removed, since it breaks Makefiles and CMake finds Ninja on PATH by itself.

Reimplemented on current main, as the original branch targeted the since-renamed react-native-node-api-cmake. The out/libweak-node-api.so link failure that kept this in draft no longer reproduces, as weak-node-api no longer sets that output directory.

Fallback builds run serially, as cmake --build isn't passed --parallel.

Test plan

  • weak-node-api Android build with Ninja hidden from PATH (all 4 ABIs, Unix Makefiles)
  • Same build with Ninja available (all 4 ABIs, generator stays Ninja)
  • cmake-rn tests, Prettier and ESLint
  • Android test app in CI (Android 🤖)
  • An addon or the test app built using the fallback

🤖 Generated with Claude Code

@kraenhansen kraenhansen self-assigned this May 22, 2025
@kraenhansen kraenhansen added the enhancement New feature or request label May 22, 2025
@changeset-bot

changeset-bot Bot commented May 22, 2025

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: aba1cde

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@shirakaba

shirakaba commented Jun 21, 2025 •

Copy link
Copy Markdown
Collaborator

Does the fact that Chromium is dropping Ninja in favour of Siso have any impact on this?

@kraenhansen

Copy link
Copy Markdown
Collaborator Author

Does the fact that Chromium is dropping Ninja in favour of Siso have any impact on this?
Likely not.

Using Ninja by default is just to get the fastest builds possible and CMake doesn't support Siso:
https://cmake.org/cmake/help/latest/manual/cmake-generators.7.html#command-line-build-tool-generators

This suggested change is just a simple way to degrade gracefully, in case the Ninja is not installed, to not force library authors into using Ninja - if they absolutely doesn't want to install it.

@kraenhansen
kraenhansen force-pushed the main branch 4 times, most recently from 90dd405 to 8dac805 Compare July 7, 2025 12:30
@kraenhansen kraenhansen added the Android 🤖 Anything related to the Android platform (Gradle, NDK, Android SDK) label Oct 31, 2026
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@kraenhansen
kraenhansen force-pushed the kh/ninja-makefile-fallback branch from aba1cde to 3189125 Compare October 31, 2026 12:28
@kraenhansen kraenhansen changed the title Ninja makefile fallback Fall back to Unix Makefiles when Ninja is missing Oct 31, 2026
@kraenhansen
kraenhansen marked this pull request as ready for review October 31, 2026 12:31
@kraenhansen
kraenhansen merged commit e3ab1a1 into main Oct 31, 2026
10 checks passed
@kraenhansen
kraenhansen deleted the kh/ninja-makefile-fallback branch October 31, 2026 12:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Android 🤖 Anything related to the Android platform (Gradle, NDK, Android SDK) enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

build-weak-node-api requires Ninja

2 participants