@@ -268,6 +268,13 @@ class XCodeProjectExporter : public ProjectExporter
268268
269269 else if (type.isDynamicLibrary ())
270270 targets.add (new Target (Target::DynamicLibrary, *this ));
271+
272+ // Open-Ephys
273+ else if (type.isOpenEphysPlugin ())
274+ {
275+ targets.add (new Target (Target::OpenEphysPlugIn, *this ));
276+ addOpenEphysPluginSettings ();
277+ }
271278
272279 else if (type.isAudioPlugin ())
273280 {
@@ -352,7 +359,10 @@ class XCodeProjectExporter : public ProjectExporter
352359 vst3BinaryLocation (config, Ids::xcodeVst3BinaryLocation, nullptr , " $(HOME)/Library/Audio/Plug-Ins/VST3/" ),
353360 auBinaryLocation (config, Ids::xcodeAudioUnitBinaryLocation, nullptr , " $(HOME)/Library/Audio/Plug-Ins/Components/" ),
354361 rtasBinaryLocation (config, Ids::xcodeRtasBinaryLocation, nullptr , " /Library/Application Support/Digidesign/Plug-Ins/" ),
355- aaxBinaryLocation (config, Ids::xcodeAaxBinaryLocation, nullptr , " /Library/Application Support/Avid/Audio/Plug-Ins/" )
362+ aaxBinaryLocation (config, Ids::xcodeAaxBinaryLocation, nullptr , " /Library/Application Support/Avid/Audio/Plug-Ins/" ),
363+ // Open-Ephys
364+ openEphysProjectLocation (config, Ids::xcodeOpenEphysProjectLocation, nullptr , " ../../../plugin-gui" ),
365+ openEphysBinaryLocation (config, Ids::xcodeOpenEphysBinaryLocation, nullptr , " $(HOME)/Library/Application Support/open-ephys/PlugIns/" )
356366 {
357367 }
358368
@@ -363,6 +373,7 @@ class XCodeProjectExporter : public ProjectExporter
363373 customXcodeFlags, cppLanguageStandard, cppStandardLibrary, codeSignIdentity;
364374 CachedValue<bool > fastMathEnabled, linkTimeOptimisationEnabled, stripLocalSymbolsEnabled;
365375 CachedValue<String> vstBinaryLocation, vst3BinaryLocation, auBinaryLocation, rtasBinaryLocation, aaxBinaryLocation;
376+ CachedValue<String> openEphysProjectLocation, openEphysBinaryLocation; // Open-Ephys
366377
367378 // ==========================================================================
368379 var getDefaultOptimisationLevel () const override { return var ((int ) (isDebug () ? gccO0 : gccO3)); }
@@ -439,6 +450,11 @@ class XCodeProjectExporter : public ProjectExporter
439450
440451 props.add (new ChoicePropertyComponent (cppStandardLibrary.getPropertyAsValue (), " C++ Library" , StringArray (cppLibNames), cppLibValues),
441452 " The type of C++ std lib that will be linked." );
453+
454+ // Open-Ephys
455+ if (project.getProjectType ().isOpenEphysPlugin ())
456+ props.add (new TextWithDefaultPropertyComponent<String> (openEphysProjectLocation, " Plugin GUI Project Location" , 1024 ),
457+ " The location of the Open-Ephys plugin-gui project root directory." );
442458
443459 props.add (new TextWithDefaultPropertyComponent<String> (codeSignIdentity, " Code-signing Identity" , 1024 ),
444460 " The name of a code-signing identity for Xcode to apply." );
@@ -476,6 +492,11 @@ class XCodeProjectExporter : public ProjectExporter
476492 if (project.shouldBuildAAX ().getValue ())
477493 props.add (new TextWithDefaultPropertyComponent<String> (aaxBinaryLocation, " AAX Binary location" , 1024 ),
478494 " The folder in which the compiled AAX binary should be placed." );
495+
496+ // Open-Ephys
497+ if (project.shouldBuildOpenEphysPlugin ().getValue ())
498+ props.add (new TextWithDefaultPropertyComponent<String> (openEphysBinaryLocation, " Open Ephys Plugin Binary location" , 1024 ),
499+ " The folder in which the compiled Open Ephys Plugin should be placed." );
479500 }
480501 };
481502
@@ -519,6 +540,7 @@ class XCodeProjectExporter : public ProjectExporter
519540 AudioUnitPlugIn = 14 ,
520541 AudioUnitv3PlugIn = 15 ,
521542 StandalonePlugIn = 16 ,
543+ OpenEphysPlugIn = 17 ,
522544
523545 SharedCodeTarget = 20 , // internal
524546 AggregateTarget = 21 ,
@@ -686,6 +708,18 @@ class XCodeProjectExporter : public ProjectExporter
686708 xcodeCreatePList = false ;
687709 xcodeCopyToProductInstallPathAfterBuild = false ;
688710 break ;
711+
712+ case OpenEphysPlugIn:
713+ xcodeIsBundle = true ;
714+ xcodeIsExecutable = false ;
715+ xcodeCreatePList = true ;
716+ xcodePackageType = " BNDL" ;
717+ xcodeBundleSignature = " ????" ;
718+ xcodeFileType = " wrapper.cfbundle" ;
719+ xcodeBundleExtension = " .bundle" ;
720+ xcodeProductType = " com.apple.product-type.bundle" ;
721+ xcodeCopyToProductInstallPathAfterBuild = false ;
722+ break ;
689723
690724 default :
691725 // unknown target type!
@@ -711,6 +745,7 @@ class XCodeProjectExporter : public ProjectExporter
711745 case RTASPlugIn: return " RTAS" ;
712746 case SharedCodeTarget: return " Shared Code" ;
713747 case AggregateTarget: return " All" ;
748+ case OpenEphysPlugIn: return " OpenEphys Plugin" ;
714749 default : return " undefined" ;
715750 }
716751 }
@@ -727,6 +762,9 @@ class XCodeProjectExporter : public ProjectExporter
727762 bool shouldBuildAU () const { return owner.supportsAU () && owner.project .shouldBuildAU ().getValue () && (type == SharedCodeTarget || type == AudioUnitPlugIn); }
728763 bool shouldBuildAUv3 () const { return owner.supportsAUv3 () && owner.project .shouldBuildAUv3 ().getValue () && (type == SharedCodeTarget || type == AudioUnitv3PlugIn); }
729764 bool shouldBuildStandalone () const { return owner.project .shouldBuildStandalone ().getValue () && (type == SharedCodeTarget || type == StandalonePlugIn); }
765+
766+ // Open-Ephys
767+ bool shouldBuildOpenEphys () const { return owner.project .shouldBuildOpenEphysPlugin ().getValue () && (type == SharedCodeTarget || type == OpenEphysPlugIn); }
730768
731769 String getID () const
732770 {
@@ -1051,6 +1089,9 @@ class XCodeProjectExporter : public ProjectExporter
10511089 defines.set (" JucePlugin_Build_AAX" , (shouldBuildAAX () ? " 1" : " 0" ));
10521090 defines.set (" JucePlugin_Build_Standalone" , (shouldBuildStandalone () ? " 1" : " 0" ));
10531091 }
1092+
1093+ if (type == Target::OpenEphysPlugIn)
1094+ defines.set (" JucePlugin_Build_OpenEphys" , (shouldBuildOpenEphys () ? " 1" : " 0" ));
10541095
10551096 defines = mergePreprocessorDefs (defines, owner.getAllPreprocessorDefs (config));
10561097
@@ -1085,6 +1126,7 @@ class XCodeProjectExporter : public ProjectExporter
10851126 case RTASPlugIn: return config.rtasBinaryLocation .get ();
10861127 case AAXPlugIn: return config.aaxBinaryLocation .get ();
10871128 case SharedCodeTarget: return owner.isiOS () ? " @executable_path/Frameworks" : " @executable_path/../Frameworks" ;
1129+ case OpenEphysPlugIn: return config.openEphysBinaryLocation .get (); // Open-Ephys
10881130 default : return String ();
10891131 }
10901132 }
@@ -1094,6 +1136,9 @@ class XCodeProjectExporter : public ProjectExporter
10941136 {
10951137 if (xcodeIsBundle)
10961138 flags.add (" -bundle" );
1139+
1140+ if (owner.project .getProjectType ().isOpenEphysPlugin ())
1141+ flags.add (" -undefined dynamic_lookup" );
10971142
10981143 const Array<RelativePath>& extraLibs = config.isDebug () ? xcodeExtraLibrariesDebug
10991144 : xcodeExtraLibrariesRelease;
@@ -1920,7 +1965,7 @@ class XCodeProjectExporter : public ProjectExporter
19201965 s.add (" GCC_WARN_MISSING_PARENTHESES = YES" );
19211966 s.add (" GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES" );
19221967 s.add (" GCC_WARN_TYPECHECK_CALLS_TO_PRINTF = YES" );
1923- s.add (" WARNING_CFLAGS = -Wreorder" );
1968+ s.add (projectType. isOpenEphysPlugin ()? " WARNING_CFLAGS = \" -Wreorder -Wno-inconsistent-missing-override \" " : " WARNING_CFLAGS = -Wreorder " ); // Open-Ephys
19241969 s.add (" GCC_MODEL_TUNING = G5" );
19251970
19261971 if (projectType.isStaticLibrary ())
@@ -1963,6 +2008,10 @@ class XCodeProjectExporter : public ProjectExporter
19632008 s.add (" DEBUG_INFORMATION_FORMAT = \" dwarf\" " );
19642009
19652010 s.add (" PRODUCT_NAME = \" " + replacePreprocessorTokens (config, config.getTargetBinaryNameString ()) + " \" " );
2011+
2012+ if (project.getProjectType ().isOpenEphysPlugin ());
2013+ s.add (" PLUGIN_GUI_PROJECT_DIR = " + config.openEphysProjectLocation .get ().quoted ());
2014+
19662015 return s;
19672016 }
19682017
@@ -2754,6 +2803,14 @@ class XCodeProjectExporter : public ProjectExporter
27542803 for (int i = 0 ; i < numElementsInArray (p); ++i)
27552804 addToExtraSearchPaths (rtasFolder.getChildFile (p[i]));
27562805 }
2806+
2807+ void addOpenEphysPluginSettings ()
2808+ {
2809+ extraSearchPaths.add (" $(PLUGIN_GUI_PROJECT_DIR)/JuceLibraryCode" );
2810+ extraSearchPaths.add (" $(PLUGIN_GUI_PROJECT_DIR)/JuceLibraryCode/modules" );
2811+ extraSearchPaths.add (" $(PLUGIN_GUI_PROJECT_DIR)/Source/Plugins/Headers" );
2812+ extraSearchPaths.add (" $(PLUGIN_GUI_PROJECT_DIR)/Source/Plugins/CommonLibs" );
2813+ }
27572814
27582815 JUCE_DECLARE_NON_COPYABLE (XCodeProjectExporter)
27592816};
0 commit comments