From c410494e45342151efd582ab80f68eb6f0ee875b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Szymon=20Kozio=C5=82?= Date: Fri, 6 Nov 2026 15:30:37 +0100 Subject: [PATCH] =?UTF-8?q?fix(=F0=9F=8D=8F):=20build=20the=20pod=20with?= =?UTF-8?q?=20use=5Fframeworks!?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sources include headers from other folders by bare name ("GPU.h"). use_frameworks! drops Pods/Headers/Private and the header map is off (#438), so those includes failed with "file not found". Put every folder of internalHeaderDirs on HEADER_SEARCH_PATHS, the same list the Swift package uses. --- packages/webgpu/Package.swift | 1 + packages/webgpu/react-native-webgpu.podspec | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/webgpu/Package.swift b/packages/webgpu/Package.swift index 1793b97bb..54780446f 100644 --- a/packages/webgpu/Package.swift +++ b/packages/webgpu/Package.swift @@ -128,6 +128,7 @@ if let skiaPath = nodePackage("react-native-skia"), // cpp/rnwgpu), so every directory that's the target of one of those bare // includes has to be listed explicitly here. The "webgpu/..." and "dawn/..." // includes resolve through the Dawn xcframework's embedded headers. +// Keep in sync with header_dirs in react-native-webgpu.podspec. let internalHeaderDirs = [ "apple", "cpp", diff --git a/packages/webgpu/react-native-webgpu.podspec b/packages/webgpu/react-native-webgpu.podspec index 49d84612f..09beace03 100644 --- a/packages/webgpu/react-native-webgpu.podspec +++ b/packages/webgpu/react-native-webgpu.podspec @@ -95,8 +95,14 @@ Pod::Spec.new do |s| s.frameworks = "AVFoundation", "CoreMedia", "CoreVideo", "ImageIO" end + # Under use_frameworks!, bare includes across folders (e.g. "GPU.h") + # resolve only through these paths. Keep in sync with internalHeaderDirs + # in Package.swift. + header_dirs = %w[apple cpp cpp/jsi cpp/rnwgpu cpp/rnwgpu/api cpp/rnwgpu/api/descriptors cpp/rnwgpu/async] + header_search_paths = header_dirs.map { |dir| "\"$(PODS_TARGET_SRCROOT)/#{dir}\"" } + s.pod_target_xcconfig = { - 'HEADER_SEARCH_PATHS' => "$(PODS_TARGET_SRCROOT)/cpp \"#{dawn_include}\"", + 'HEADER_SEARCH_PATHS' => (header_search_paths + ["\"#{dawn_include}\""]).join(' '), # Xcode's all-target headermaps let same-named headers leak across pods # (e.g. @shopify/react-native-skia keeps a jsi/ helper layer with # identical relative header paths). Resolve includes strictly through our