Skip to content

Commit

Permalink
Add option to specify vendor sdks (BrainiumLLC#49)
Browse files Browse the repository at this point in the history
* Add option to specify vendor sdks

* formatting fix
  • Loading branch information
ArthurKValladares authored Nov 3, 2021
1 parent b85b13c commit 7d93364
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/apple/config/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ pub struct Platform {
features: Option<Vec<String>>,
frameworks: Option<Vec<String>>,
vendor_frameworks: Option<Vec<String>>,
vendor_sdks: Option<Vec<String>>,
asset_catalogs: Option<Vec<PathBuf>>,
additional_targets: Option<Vec<PathBuf>>,
}
Expand All @@ -41,6 +42,10 @@ impl Platform {
self.vendor_frameworks.as_deref().unwrap_or_else(|| &[])
}

pub fn vendor_sdks(&self) -> &[String] {
self.vendor_sdks.as_deref().unwrap_or_else(|| &[])
}

pub fn asset_catalogs(&self) -> Option<&[PathBuf]> {
self.asset_catalogs.as_deref()
}
Expand Down
2 changes: 2 additions & 0 deletions src/apple/project.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,13 @@ pub fn gen(
map.insert("file-groups", &source_dirs);
map.insert("ios-frameworks", metadata.ios().frameworks());
map.insert("ios-vendor-frameworks", metadata.ios().vendor_frameworks());
map.insert("ios-vendor-sdks", metadata.ios().vendor_sdks());
map.insert("macos-frameworks", metadata.macos().frameworks());
map.insert(
"macos-vendor-frameworks",
metadata.macos().vendor_frameworks(),
);
map.insert("macos-vendor-sdks", metadata.macos().vendor_frameworks());
map.insert("asset-catalogs", asset_catalogs);
map.insert(
"ios-additional-targets",
Expand Down
4 changes: 4 additions & 0 deletions templates/platforms/xcode/project.yml.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ targets:
embed: false
{{~#each ios-vendor-frameworks}}
- framework: {{prefix-path this}}{{/each}}
{{~#each ios-vendor-sdks}}
- sdk: {{prefix-path this}}{{/each}}
- sdk: CoreGraphics.framework
- sdk: Metal.framework
- sdk: MetalKit.framework
Expand Down Expand Up @@ -106,6 +108,8 @@ targets:
embed: false
{{~#each macos-vendor-frameworks}}
- framework: {{prefix-path this}}{{/each}}
{{~#each macos-vendor-sdks}}
- sdk: {{prefix-path this}}{{/each}}
- sdk: Metal.framework
{{~#each macos-frameworks}}
- sdk: {{this}}.framework{{/each}}
Expand Down

0 comments on commit 7d93364

Please sign in to comment.