Skip to content

Commit aba1cde

Browse files
committed
Use Unix Makefiles as fallback when Ninja is missing
1 parent 6c4dee4 commit aba1cde

File tree

1 file changed

+11
-2
lines changed
  • packages/react-native-node-api-cmake/src

1 file changed

+11
-2
lines changed

packages/react-native-node-api-cmake/src/android.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,16 @@ import path from "node:path";
44

55
import { AndroidTriplet } from "react-native-node-api-modules";
66

7+
import { isNinjaAvailable } from "./ninja.js";
8+
9+
function getCmakeGenerator() {
10+
if (isNinjaAvailable()) {
11+
return "Ninja";
12+
} else {
13+
return "Unix Makefiles";
14+
}
15+
}
16+
717
export const DEFAULT_ANDROID_TRIPLETS = [
818
"aarch64-linux-android",
919
"armv7a-linux-androideabi",
@@ -49,9 +59,8 @@ export function getAndroidConfigureCmakeArgs({
4959
const architecture = ANDROID_ARCHITECTURES[triplet];
5060

5161
return [
52-
// Use the XCode as generator for Apple platforms
5362
"-G",
54-
"Ninja",
63+
getCmakeGenerator(),
5564
"--toolchain",
5665
toolchainPath,
5766
"-D",

0 commit comments

Comments
 (0)