# Compiling and distributing plugins/apps for several CPU architectures

**URL:** <https://forum.juce.com/t/compiling-and-distributing-plugins-apps-for-several-cpu-architectures/25203>\
**Category:** General JUCE discussion\
**Created:** [November 20, 2017, 7:26am UTC](https://forum.juce.com/t/compiling-and-distributing-plugins-apps-for-several-cpu-architectures/25203 "2017-11-20T07:26:09Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![fr810](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/fr810/32/841_2.png) [@fr810](https://forum.juce.com/u/fr810)\
**Post date:** [November 22, 2017, 9:33am UTC](https://forum.juce.com/t/compiling-and-distributing-plugins-apps-for-several-cpu-architectures/25203/4 "2017-11-22T09:33:47Z")

</div>

+1 to what Tom wrote. Most compilers support some form of enabling/disabling machine target options for specific functions, but support for this is limited and sometimes a bit unpredictable (for example, what happens when these functions are inlined).

I find that it more reliable to simply compile the processing part (basically the `processBlock` part) of the plug-in several times with different target flags. Each time you compile, you also change a template parameter of your top-level entry class (for example via a pre-processor define that you provide to the compiler command-line) so that you don’t get any symbol clashes when linking everything together. You then figure out which CPU your plug-in is running on when prepareToPlay is called and instantiate the processing part with the correct template parameter.

---

_[View the full topic](https://forum.juce.com/t/compiling-and-distributing-plugins-apps-for-several-cpu-architectures/25203)._
