Skip to content

Commit 80351c9

Browse files
committed
Merge branch 'main' of github.com:scottmas/react-native-webgpu
2 parents 293fd99 + a9fc71d commit 80351c9

File tree

2 files changed

+5
-48
lines changed

2 files changed

+5
-48
lines changed

README.md

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -212,16 +212,6 @@ cd packages/webgpu
212212
yarn build-dawn
213213
```
214214

215-
You can also filter the platforms to build, for instance to skip the macOS and visionOS build:
216-
```sh
217-
yarn build-dawn --exclude=xros,xrsimulator,macosx
218-
```
219-
220-
Alternatively if you want to build for a specific platform only, you can use `includeOnly`.
221-
```sh
222-
yarn build-dawn --includeOnly=xros,xrsimulator
223-
```
224-
225215
### Downloading Dawn
226216

227217
There is an alternative way which is to download the prebuilt binaries from GitHub.

packages/webgpu/scripts/build/dawn.ts

Lines changed: 5 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33

44
import { chdir } from "process";
55

6-
import yargs from "yargs";
7-
import { hideBin } from "yargs/helpers";
8-
96
import type { Platform } from "./dawn-configuration";
107
import { $, mapKeys } from "./util";
118
import {
@@ -17,37 +14,6 @@ import {
1714
projectRoot,
1815
} from "./dawn-configuration";
1916

20-
const { argv } = yargs(hideBin(process.argv))
21-
.option("exclude", {
22-
type: "string",
23-
describe: "Comma-separated list of platforms to exclude",
24-
})
25-
.option("includeOnly", {
26-
type: "string",
27-
describe: "Comma-separated list of platforms to include exclusively",
28-
});
29-
30-
// Function to filter platforms based on exclude list
31-
function filterPlatforms<T extends string>(
32-
platforms: T[],
33-
excludeList: string[],
34-
includeOnlyList: string[],
35-
): T[] {
36-
if (includeOnlyList.length > 0) {
37-
return platforms.filter((platform) => includeOnlyList.includes(platform));
38-
} else {
39-
return platforms.filter((platform) => !excludeList.includes(platform));
40-
}
41-
}
42-
43-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
44-
const args = argv as any;
45-
const excludeList = args.exclude ? args.exclude.split(",") : [];
46-
const includeOnlyList = args.includeOnly ? args.includeOnly.split(",") : [];
47-
48-
const platforms = (plts: string[]) =>
49-
filterPlatforms(plts, excludeList, includeOnlyList) as Platform[];
50-
5117
const commonArgs = {
5218
CMAKE_BUILD_TYPE: "Release",
5319
BUILD_SAMPLES: "OFF",
@@ -73,7 +39,7 @@ const PLATFORM_MAP: Record<string, string> = {
7339
};
7440

7541
const android = {
76-
platforms: platforms(["arm64-v8a", "armeabi-v7a", "x86", "x86_64"]),
42+
platforms: ["arm64-v8a", "armeabi-v7a", "x86", "x86_64"] as Platform[],
7743
args: {
7844
CMAKE_TOOLCHAIN_FILE: "$ANDROID_NDK/build/cmake/android.toolchain.cmake",
7945
ANDROID_PLATFORM: "android-26",
@@ -83,9 +49,9 @@ const android = {
8349

8450
const apple = {
8551
matrix: {
86-
arm64: platforms(["iphoneos", "iphonesimulator", "xros", "xrsimulator"]),
87-
x86_64: platforms(["iphonesimulator"]),
88-
universal: platforms(["macosx"]),
52+
arm64: ["iphoneos", "iphonesimulator", "xros", "xrsimulator"],
53+
x86_64: ["iphonesimulator"],
54+
universal: ["macosx"],
8955
},
9056
args: {
9157
CMAKE_TOOLCHAIN_FILE: `${__dirname}/apple.toolchain.cmake`,
@@ -96,6 +62,7 @@ const apple = {
9662
(async () => {
9763
process.chdir("../..");
9864
process.chdir("externals/dawn");
65+
$("git submodule update --init third_party/abseil-cpp");
9966
$(
10067
"git reset --hard HEAD && cd third_party/abseil-cpp && git reset --hard HEAD && cd ../..",
10168
);

0 commit comments

Comments
 (0)