Skip to content

Commit

Permalink
fix: plugin for debug simulator
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
tyrauber committed Jan 31, 2024
1 parent 62f118f commit d133e6d
Showing 1 changed file with 5 additions and 2 deletions.
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 d133e6d

Please sign in to comment.