# Building a JUCE Plugin for "Any Mac"?

**URL:** <https://forum.juce.com/t/building-a-juce-plugin-for-any-mac/62574>\
**Category:** General JUCE discussion\
**Created:** [August 21, 2024, 2:42pm UTC](https://forum.juce.com/t/building-a-juce-plugin-for-any-mac/62574 "2024-08-21T14:42:07Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![nuvibrations](https://avatars.discourse-cdn.com/v4/letter/n/8797f3/32.png) [@nuvibrations](https://forum.juce.com/u/nuvibrations)\
**Post date:** [August 21, 2024, 2:42pm UTC](https://forum.juce.com/t/building-a-juce-plugin-for-any-mac/62574/1 "2024-08-21T14:42:07Z")

</div>

Hello JUCE Developers!

I’m trying to build a universal version of a plugin using xcodebuild and Projucer 7.0.9. The output when I run xcode build is:

/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -project Builds/MacOSX/Perspective.xcodeproj -scheme “Perspective - All” -c— xcodebuild: WARNING: Using the first of multiple matching destinations:  
{ platform:macOS, arch:x86\_64, id:8BD34136-9ED7-5930-A2D6-A78A5ADCA922, name:My Mac }  
{ platform:macOS, name:Any Mac }

… and the build ends up being whatever architecture is active when the build is started. If I build on an M1 with a terminal running in native mode, I get an arm64 build. If I build running in Rosetta mode, I get x86\_64 at the build.

I have tried a variety of settings in Projucer, xcode and xcodebuild with no luck. My build script runs projucer to set the version before calling xcodebuild with the following parameters:

–set-version $version $jucer\_file

and my xcodebuild command line is:

xcodebuild -project Builds/MacOSX/plugin.xcodeproj -scheme “Plugin - All” -configuration Release ONLY\_ACTIVE\_ARCHS=NO -destination ‘name=Any Mac/platform=macOS’

Whats the secret formula to get a universal build?

---

<div class="post-metadata">

**Author:** ![otristan](https://avatars.discourse-cdn.com/v4/letter/o/f0a364/32.png) [@otristan](https://forum.juce.com/u/otristan)\
**Post date:** [August 21, 2024, 3:05pm UTC](https://forum.juce.com/t/building-a-juce-plugin-for-any-mac/62574/2 "2024-08-21T15:05:45Z")

</div>

Since Xcode 15.3 you can override architecture built in Scheme.  
The default option is Match Run Destination which override the fact that you have set universal binary

---

<div class="post-metadata">

**Author:** ![ibisum](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/ibisum/32/21288_2.png) [@ibisum](https://forum.juce.com/u/ibisum)\
**Post date:** [August 22, 2024, 8:40am UTC](https://forum.juce.com/t/building-a-juce-plugin-for-any-mac/62574/3 "2024-08-22T08:40:30Z")

</div>

After _much_ hassle with this myself, I have adopted a strategy of using VM’s for any older MacOS versions I want to target, and maintain a small suite of these for the purpose. Its the only way to be sure you don’t get backlogged, just because Apple have decided to apply an antipattern designed to make people upgrade their hardware …

---

<div class="post-metadata">

**Author:** ![adamstark](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/adamstark/32/122_2.png) [@adamstark](https://forum.juce.com/u/adamstark)\
**Post date:** [August 22, 2024, 9:52am UTC](https://forum.juce.com/t/building-a-juce-plugin-for-any-mac/62574/4 "2024-08-22T09:52:11Z")

</div>

Is there some way to set this in the Projucer so that it builds all architectures? I’m building a plugin via Github Actions and creating the XCode project from the Projucer so it isn’t easy for me to select ‘Any Mac’ just before building.

I discovered this by sending my (supposedly) universal binary to someone who couldn’t run it, built from a project that previously produced universal binaries. I expect others will have this same issue.

---

<div class="post-metadata">

**Author:** ![ibisum](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/ibisum/32/21288_2.png) [@ibisum](https://forum.juce.com/u/ibisum)\
**Post date:** [August 22, 2024, 10:06am UTC](https://forum.juce.com/t/building-a-juce-plugin-for-any-mac/62574/5 "2024-08-22T10:06:25Z")

</div>

If multiple architectures builds are important to you, you must emmigrate away from the Projucer and convert to a CMake-based project, instead. The investment made in doing this is worth far more than the ‘comfort’ in staying on Projucer-based projects. Projucer is great for getting started - for _production_, CMake is far, far superior.

This is the most effective way to handle cross-platform, multi-architecture build strategies - and then, when you get it working, to save yourself immense pain as time moves on, move the CMake project into VM’s for each OS target.

---

<div class="post-metadata">

**Author:** ![adamstark](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/adamstark/32/122_2.png) [@adamstark](https://forum.juce.com/u/adamstark)\
**Post date:** [August 22, 2024, 10:36am UTC](https://forum.juce.com/t/building-a-juce-plugin-for-any-mac/62574/6 "2024-08-22T10:36:21Z")

</div>

Thank you. I have no doubt that you are correct and have been meaning to move to CMake for this for a while.

I think given it looks like a single setting to change it’d be good for the Projucer to have the option though.

---

<div class="post-metadata">

**Author:** ![aleFX](https://avatars.discourse-cdn.com/v4/letter/a/aca169/32.png) [@aleFX](https://forum.juce.com/u/aleFX)\
**Post date:** [August 25, 2024, 5:14pm UTC](https://forum.juce.com/t/building-a-juce-plugin-for-any-mac/62574/7 "2024-08-25T17:14:20Z")

</div>

In CMake just add:

```auto
if (APPLE)
   set(CMAKE_OSX_ARCHITECTURES "x86_64;arm64" CACHE INTERNAL "")
endif()

```

---

<div class="post-metadata">

**Author:** ![adamstark](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/adamstark/32/122_2.png) [@adamstark](https://forum.juce.com/u/adamstark)\
**Post date:** [August 27, 2024, 9:44am UTC](https://forum.juce.com/t/building-a-juce-plugin-for-any-mac/62574/8 "2024-08-27T09:44:02Z")

</div>

As an answer to the original post, the following flag for `xcodebuild` worked for me to get all architectures specified in the Projucer to be built…

`-destination "generic/platform=macOS"`

---

<div class="post-metadata">

**Author:** ![nuvibrations](https://avatars.discourse-cdn.com/v4/letter/n/8797f3/32.png) [@nuvibrations](https://forum.juce.com/u/nuvibrations)\
**Post date:** [August 27, 2024, 1:15pm UTC](https://forum.juce.com/t/building-a-juce-plugin-for-any-mac/62574/9 "2024-08-27T13:15:49Z")

</div>

Thanks! That command line did the trick!

---

<div class="post-metadata">

**Author:** ![eyalamir](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/eyalamir/32/2978_2.png) [@eyalamir](https://forum.juce.com/u/eyalamir)\
**Post date:** [August 27, 2024, 3:23pm UTC](https://forum.juce.com/t/building-a-juce-plugin-for-any-mac/62574/10 "2024-08-27T15:23:47Z")

</div>

> [@aleFX](#):
>
> ```auto
> if (APPLE)
> set(CMAKE_OSX_ARCHITECTURES "x86_64;arm64" CACHE INTERNAL "")
> endif()
> 
> ```

That is correct.

Totally nitpicking comment, but there’s no need for `if(APPLE)` there.

This would just do nothing on Windows/Linux. Same with any `CMAKE_OSX_` flags or `CMAKE_MSVC_` (that would only work on Windows).

---

<div class="post-metadata">

**Author:** ![Burshan](https://avatars.discourse-cdn.com/v4/letter/b/c4cdca/32.png) [@Burshan](https://forum.juce.com/u/Burshan)\
**Post date:** [December 8, 2024, 8:19pm UTC](https://forum.juce.com/t/building-a-juce-plugin-for-any-mac/62574/11 "2024-12-08T20:19:06Z")

</div>

Hey, I’m running into a similar issue. Everything works fine when I build it on my Mac, but when I try to build it for any Mac (for distribution), mbedtls throws an error because I don’t have the ARM version installed on my computer. Is there any way to compile the ARM version on my machine or get it compiled?

---

<div class="post-metadata">

**Author:** ![zsliu98](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/zsliu98/32/22502_2.png) [@zsliu98](https://forum.juce.com/u/zsliu98)\
**Post date:** [December 8, 2024, 11:50pm UTC](https://forum.juce.com/t/building-a-juce-plugin-for-any-mac/62574/12 "2024-12-08T23:50:58Z")

</div>

I have not encountered such problem in my project (`-DCMAKE_OSX_ARCHITECTURES="arm64;x86_64"` is enough for me).

You may use the Github Runner Image (macOS 14 arm64) to build your plugin. Here is a good starting point:

> **[GitHub - sudara/pamplejuce: A JUCE audio plugin template. JUCE 8, Catch2,...](https://github.com/sudara/pamplejuce)**
>
> A JUCE audio plugin template. JUCE 8, Catch2, Pluginval, macOS notarization, Azure Trusted Signing, Github Actions

---

<div class="post-metadata">

**Author:** ![Burshan](https://avatars.discourse-cdn.com/v4/letter/b/c4cdca/32.png) [@Burshan](https://forum.juce.com/u/Burshan)\
**Post date:** [March 27, 2025, 10:36am UTC](https://forum.juce.com/t/building-a-juce-plugin-for-any-mac/62574/14 "2025-03-27T10:36:33Z")

</div>

@zsilu98 Did you manage to get it running on ARM?  
Also, do I even need to compile it manually for that? Or is there a prebuilt version I can use somehow?

Thanks in advance

---

<div class="post-metadata">

**Author:** ![zsliu98](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/zsliu98/32/22502_2.png) [@zsliu98](https://forum.juce.com/u/zsliu98)\
**Post date:** [March 27, 2025, 2:21pm UTC](https://forum.juce.com/t/building-a-juce-plugin-for-any-mac/62574/15 "2025-03-27T14:21:40Z")

</div>

> Did you manage to get it running on ARM?

I use GitHub actions to compile universal binaries. It works fine.

> Also, do I even need to compile it manually for that?

The release binaries are compiled on GitHub runner images.
