diff --git a/README.md b/README.md index b61a27c70..7538378fd 100644 --- a/README.md +++ b/README.md @@ -212,16 +212,6 @@ cd packages/webgpu yarn build-dawn ``` -You can also filter the platforms to build, for instance to skip the macOS and visionOS build: -```sh -yarn build-dawn --exclude=xros,xrsimulator,macosx -``` - -Alternatively if you want to build for a specific platform only, you can use `includeOnly`. -```sh -yarn build-dawn --includeOnly=xros,xrsimulator -``` - ### Downloading Dawn There is an alternative way which is to download the prebuilt binaries from GitHub. diff --git a/packages/webgpu/scripts/build/dawn.ts b/packages/webgpu/scripts/build/dawn.ts index 617cf0a5a..6e9ba6034 100644 --- a/packages/webgpu/scripts/build/dawn.ts +++ b/packages/webgpu/scripts/build/dawn.ts @@ -3,9 +3,6 @@ import { chdir } from "process"; -import yargs from "yargs"; -import { hideBin } from "yargs/helpers"; - import type { Platform } from "./dawn-configuration"; import { $, mapKeys } from "./util"; import { @@ -17,37 +14,6 @@ import { projectRoot, } from "./dawn-configuration"; -const { argv } = yargs(hideBin(process.argv)) - .option("exclude", { - type: "string", - describe: "Comma-separated list of platforms to exclude", - }) - .option("includeOnly", { - type: "string", - describe: "Comma-separated list of platforms to include exclusively", - }); - -// Function to filter platforms based on exclude list -function filterPlatforms( - platforms: T[], - excludeList: string[], - includeOnlyList: string[], -): T[] { - if (includeOnlyList.length > 0) { - return platforms.filter((platform) => includeOnlyList.includes(platform)); - } else { - return platforms.filter((platform) => !excludeList.includes(platform)); - } -} - -// eslint-disable-next-line @typescript-eslint/no-explicit-any -const args = argv as any; -const excludeList = args.exclude ? args.exclude.split(",") : []; -const includeOnlyList = args.includeOnly ? args.includeOnly.split(",") : []; - -const platforms = (plts: string[]) => - filterPlatforms(plts, excludeList, includeOnlyList) as Platform[]; - const commonArgs = { CMAKE_BUILD_TYPE: "Release", BUILD_SAMPLES: "OFF", @@ -73,7 +39,7 @@ const PLATFORM_MAP: Record = { }; const android = { - platforms: platforms(["arm64-v8a", "armeabi-v7a", "x86", "x86_64"]), + platforms: ["arm64-v8a", "armeabi-v7a", "x86", "x86_64"] as Platform[], args: { CMAKE_TOOLCHAIN_FILE: "$ANDROID_NDK/build/cmake/android.toolchain.cmake", ANDROID_PLATFORM: "android-26", @@ -83,9 +49,9 @@ const android = { const apple = { matrix: { - arm64: platforms(["iphoneos", "iphonesimulator", "xros", "xrsimulator"]), - x86_64: platforms(["iphonesimulator"]), - universal: platforms(["macosx"]), + arm64: ["iphoneos", "iphonesimulator", "xros", "xrsimulator"], + x86_64: ["iphonesimulator"], + universal: ["macosx"], }, args: { CMAKE_TOOLCHAIN_FILE: `${__dirname}/apple.toolchain.cmake`, @@ -96,6 +62,7 @@ const apple = { (async () => { process.chdir("../.."); process.chdir("externals/dawn"); + $("git submodule update --init third_party/abseil-cpp"); $( "git reset --hard HEAD && cd third_party/abseil-cpp && git reset --hard HEAD && cd ../..", );