bazelbuild / bazelbuild/rules_apple
Is there a way to specify `deps` per-architecture when using `apple_xcframework`?
- Dominant language
- Starlark
- Stars
- 593
- Forks
- 334
- Avg merge
- 16h 48m
- Merged PRs (30d)
- 9
Description
Hello!
I'm trying to use `apple_xcframework` to, well, make an XCFramework. I want to be able to specify different `deps` depending on what I've passed to `ios`, like so:
```
apple_xcframework(
name = "MyLibrary",
public_hdrs = [
"MyLibrary.h",
],
infoplists = ["Info.plist"],
bundle_id = "...",
ios = {
"simulator": [
"arm64",
],
"device": [
"arm64",
],
},
minimum_os_versions = {
"ios": "15.0",
},
deps = select({
"//mediapipe:ios_sim_arm64": [
":MyLibrary",
],
"//conditions:default": [
":MyLibrary",
"@ios_opencv//:OpencvFramework",
],
}),
)
```
The idea is that I don't link to OpenCV when compiling for the simulator. This kind of thing works when I call Bazel to build several frameworks, as I can use `select` and build one at a time. But when using apple_xcframework, I use one config for the whole thing. Assuming I don't misunderstand anything here (and I probably do) what can I do?
Thanks!
Contributor guide
Research direction
Start by reading the apple_xcframework rule and tracing how its single deps attribute is applied across the architectures in the ios configuration. Determine whether per-architecture dependencies can be supported without separate configurations, and confirm the behavior with an XCFramework build covering simulator and device inputs.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ios
- Domain
- build-system
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100