Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions apps/example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1407,7 +1407,7 @@ PODS:
- ReactCommon/turbomodule/bridging
- ReactCommon/turbomodule/core
- Yoga
- react-native-skia (2.0.0):
- react-native-skia (2.2.14):
- DoubleConversion
- glog
- hermes-engine
Expand All @@ -1433,7 +1433,7 @@ PODS:
- ReactCommon/turbomodule/bridging
- ReactCommon/turbomodule/core
- Yoga
- react-native-wgpu (0.2.5):
- react-native-wgpu (0.2.6):
- DoubleConversion
- glog
- hermes-engine
Expand Down Expand Up @@ -2245,8 +2245,8 @@ SPEC CHECKSUMS:
React-Mapbuffer: c3f4b608e4a59dd2f6a416ef4d47a14400194468
React-microtasksnativemodule: 054f34e9b82f02bd40f09cebd4083828b5b2beb6
react-native-safe-area-context: 562163222d999b79a51577eda2ea8ad2c32b4d06
react-native-skia: 99362ce77dff006719636c97f16c9713e3ec221e
react-native-wgpu: 091c71fc96e5470bdc69b5b9f1bc632540cd8a06
react-native-skia: a00cb2132c9f8a90d3dade66c56c2325c28a9fb6
react-native-wgpu: 770f8c16bebe46a176a14f16d1058ed6f6cf14b8
React-NativeModulesApple: 2c4377e139522c3d73f5df582e4f051a838ff25e
React-oscompat: ef5df1c734f19b8003e149317d041b8ce1f7d29c
React-perflogger: 9a151e0b4c933c9205fd648c246506a83f31395d
Expand Down
2 changes: 1 addition & 1 deletion packages/webgpu/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-wgpu",
"version": "0.2.5",
"version": "0.2.6",
"description": "React Native WebGPU",
"main": "lib/commonjs/index",
"module": "lib/module/index",
Expand Down
5 changes: 5 additions & 0 deletions packages/webgpu/scripts/build/dawn-configuration.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/* eslint-disable max-len */
import { $, checkFileExists, runAsync } from "./util";
import { checkDuplicateHeaders } from "../codegen/util";

export const libs = ["libwebgpu_dawn"] as const;

Expand Down Expand Up @@ -32,8 +33,12 @@ export const copyHeaders = () => {
`rm -rf ${projectRoot}/cpp/dawn/webgpu.h`,
`rm -rf ${projectRoot}/cpp/dawn/webgpu_cpp.h`,
`rm -rf ${projectRoot}/cpp/dawn/wire`,
`rm -rf ${projectRoot}/cpp/webgpu/webgpu_cpp_print.h`,
`cp externals/dawn/src/dawn/dawn.json ${projectRoot}/libs`,
].map((cmd) => $(cmd));

// Check for duplicate header names and issue warnings
checkDuplicateHeaders(`${projectRoot}/cpp`);
};

const serializeCMakeArgs = (args: Record<string, string>) => {
Expand Down
35 changes: 35 additions & 0 deletions packages/webgpu/scripts/codegen/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,38 @@ export const writeFile = (
`${labels[label]} ${file.substring(file.indexOf("/package/") + "/package/".length)}`,
);
};

export const checkDuplicateHeaders = (cppPath: string) => {
// Check for duplicate header names and issue warnings
const duplicateHeaders = $(
`find ${cppPath} -name '*.h' -type f | sed 's/.*\\///' | sort | uniq -d`,
).toString();
if (duplicateHeaders.trim()) {
console.warn("⚠️ WARNING: Found duplicate header names:");
let hasConflicts = false;

duplicateHeaders
.split("\n")
.filter(Boolean)
.forEach((filename: string) => {
const fullPaths = $(
`find ${cppPath} -name "${filename}" -type f`,
).toString();
const paths = fullPaths.split("\n").filter(Boolean);

console.warn(` ${filename}:`);
paths.forEach((filePath: string) => {
console.warn(` ${filePath}`);
});

hasConflicts = true;
});

if (hasConflicts) {
console.error(
"❌ ERROR: Duplicate headers found that will cause iOS build conflicts!",
);
exit(1);
}
}
};
Loading