Skip to content

Commit

Permalink
fix: plugin for debug simulator (#164)
Browse files Browse the repository at this point in the history
* fix: plugin for debug simulator
Only set EXCLUDED_ARCHS for Release Build Settings

Enables M1/M2’s to build in debug mode simulator, without having to open Xcode and configure the project settings manually.

* chore: update changelog
  • Loading branch information
tyrauber authored Jan 31, 2024
1 parent 62f118f commit 06b23d4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ Please add unreleased changes in the following style:
PR Title ([#123](link to my pr))
```

fix: plugin for debug simulator ([#164](https://github.com/maplibre/maplibre-react-native/pull/164)

## 10.0-alpha.0

chore: update detox ([#207](https://github.com/maplibre/maplibre-react-native/pull/207))
Expand Down
7 changes: 5 additions & 2 deletions plugin/src/withMapLibre.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,13 @@ export function setExcludedArchitectures(project: XcodeProject): XcodeProject {
const configurations = project.pbxXCBuildConfigurationSection();
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
for (const {buildSettings} of Object.values(configurations || {})) {
for (const {name, buildSettings} of Object.values(configurations || {})) {
// Guessing that this is the best way to emulate Xcode.
// Using `project.addToBuildSettings` modifies too many targets.
if (typeof buildSettings?.PRODUCT_NAME !== 'undefined') {
if (
name === 'Release' &&
typeof buildSettings?.PRODUCT_NAME !== 'undefined'
) {
buildSettings['"EXCLUDED_ARCHS[sdk=iphonesimulator*]"'] = '"arm64"';
}
}
Expand Down

0 comments on commit 06b23d4

Please sign in to comment.