diff --git a/extras/Introjucer/Source/Project/jucer_AudioPluginModule.h b/extras/Introjucer/Source/Project/jucer_AudioPluginModule.h index 1942142253..3d73d01f35 100644 --- a/extras/Introjucer/Source/Project/jucer_AudioPluginModule.h +++ b/extras/Introjucer/Source/Project/jucer_AudioPluginModule.h @@ -187,6 +187,13 @@ namespace exporter.getSetting (Ids::postbuildCommand) = String::fromUTF8 (BinaryData::AudioPluginXCodeScript_txt, BinaryData::AudioPluginXCodeScript_txtSize); } + + String createEscapedStringForVersion (ProjectExporter& exporter, const String& text) + { + // (VS10 automatically adds escape characters to the quotes for this definition) + return exporter.getVisualStudioVersion() < 10 ? CodeHelpers::addEscapeChars (text.quoted()) + : CodeHelpers::addEscapeChars (text).quoted(); + } } //============================================================================== @@ -370,12 +377,7 @@ namespace RTASHelpers exporter.msvcTargetSuffix = ".dpm"; String winbag (getRTASFolderRelativePath (exporter).getChildFile ("WinBag").toWindowsStyle()); - - // (VS10 automatically adds escape characters to the quotes for this definition) - winbag = (exporter.getVisualStudioVersion() < 10) ? CodeHelpers::addEscapeChars (winbag.quoted()) - : CodeHelpers::addEscapeChars (winbag).quoted(); - - exporter.msvcExtraPreprocessorDefs.set ("JucePlugin_WinBag_path", winbag); + exporter.msvcExtraPreprocessorDefs.set ("JucePlugin_WinBag_path", createEscapedStringForVersion (exporter, winbag)); RelativePath juceFolder (exporter.getJucePathFromTargetFolder()); if (juceFolder.getFileName() != "modules") @@ -573,7 +575,7 @@ namespace AAXHelpers { fixMissingAAXValues (exporter); - const RelativePath aaxFolder (getAAXFolderPath (exporter)); + const RelativePath aaxLibsFolder (getAAXFolderPath (exporter).getChildFile ("Libs")); if (exporter.isVisualStudio()) { @@ -582,11 +584,15 @@ namespace AAXHelpers for (ProjectExporter::ConfigIterator config (exporter); config.next();) if (config->getValue (Ids::useRuntimeLibDLL).getValue().isVoid()) config->getValue (Ids::useRuntimeLibDLL) = true; + + exporter.msvcExtraPreprocessorDefs + .set ("JucePlugin_AAXLibs_path", + createEscapedStringForVersion (exporter, aaxLibsFolder.toWindowsStyle())); } else { - exporter.xcodeExtraLibrariesDebug.add (aaxFolder.getChildFile ("Libs/Debug/libAAXLibrary.a")); - exporter.xcodeExtraLibrariesRelease.add (aaxFolder.getChildFile ("Libs/Release/libAAXLibrary.a")); + exporter.xcodeExtraLibrariesDebug.add (aaxLibsFolder.getChildFile ("Debug/libAAXLibrary.a")); + exporter.xcodeExtraLibrariesRelease.add (aaxLibsFolder.getChildFile ("Release/libAAXLibrary.a")); } writePluginCharacteristicsFile (projectSaver); diff --git a/modules/juce_audio_plugin_client/AAX/juce_AAX_Wrapper.cpp b/modules/juce_audio_plugin_client/AAX/juce_AAX_Wrapper.cpp index cd8a2c44d8..d37fa57067 100644 --- a/modules/juce_audio_plugin_client/AAX/juce_AAX_Wrapper.cpp +++ b/modules/juce_audio_plugin_client/AAX/juce_AAX_Wrapper.cpp @@ -65,6 +65,26 @@ #pragma clang diagnostic pop #endif +#if JUCE_WINDOWS + #ifndef JucePlugin_AAXLibs_path + #error "You need to define the JucePlugin_AAXLibs_path macro. (This is best done via the introjucer)" + #endif + + #if JUCE_DEBUG + #define JUCE_AAX_LIB_PATH "\\Debug\\" + #else + #define JUCE_AAX_LIB_PATH "\\Release\\" + #endif + + #if JUCE_64BIT + #define JUCE_AAX_LIB "AAXLibrary_x64.lib" + #else + #define JUCE_AAX_LIB "AAXLibrary.lib" + #endif + + #pragma comment(lib, JucePlugin_AAXLibs_path JUCE_AAX_LIB_PATH JUCE_AAX_LIB) +#endif + using juce::Component; const int32_t juceChunkType = 'juce';