Browse Source

Added extra compile and link flag options to the jucer.

tags/2021-05-28
Julian Storer 15 years ago
parent
commit
030c24c4eb
5 changed files with 31 additions and 7 deletions
  1. +14
    -5
      extras/Jucer (experimental)/Source/model/jucer_ProjectExport_MSVC.h
  2. +3
    -2
      extras/Jucer (experimental)/Source/model/jucer_ProjectExport_Make.h
  3. +6
    -0
      extras/Jucer (experimental)/Source/model/jucer_ProjectExport_XCode.h
  4. +5
    -0
      extras/Jucer (experimental)/Source/model/jucer_ProjectExporter.cpp
  5. +3
    -0
      extras/Jucer (experimental)/Source/model/jucer_ProjectExporter.h

+ 14
- 5
extras/Jucer (experimental)/Source/model/jucer_ProjectExport_MSVC.h View File

@@ -490,6 +490,9 @@ private:
compiler->setAttribute ("ProgramDataBaseFileName", windowsStylePath (intermediatesPath + "/"));
compiler->setAttribute ("WarningLevel", "3");
compiler->setAttribute ("SuppressStartupBanner", "true");
if (getExtraCompilerFlags().toString().isNotEmpty())
compiler->setAttribute ("AdditionalOptions", getExtraCompilerFlags().toString().trim());
}
createToolElement (xml, "VCManagedResourceCompilerTool");
@@ -527,14 +530,19 @@ private:
linker->setAttribute ("DataExecutionPrevention", "0");
linker->setAttribute ("TargetMachine", "1");
String extraLinkerOptions (getExtraLinkerFlags().toString());
if (isRTAS())
{
linker->setAttribute ("AdditionalOptions", "/FORCE:multiple");
extraLinkerOptions += " /FORCE:multiple";
linker->setAttribute ("DelayLoadDLLs", "DAE.dll; DigiExt.dll; DSI.dll; PluginLib.dll; DSPManager.dll");
linker->setAttribute ("ModuleDefinitionFile", getJucePathFromTargetFolder()
.getChildFile ("extras/audio plugins/wrapper/RTAS/juce_RTAS_WinExports.def")
.toWindowsStyle());
}
if (extraLinkerOptions.isNotEmpty())
linker->setAttribute ("AdditionalOptions", extraLinkerOptions.trim());
}
else
{
@@ -699,8 +707,8 @@ private:
<< " /YX /FD /c " << extraDebugFlags << " /Zm1024" << newLine
<< "# ADD CPP /nologo " << (isDebug ? "/MTd" : "/MT") << " /W3 /GR /GX /" << optimisationFlag
<< " /I " << getHeaderSearchPaths (config).joinIntoString (" /I ")
<< " /D " << defines << " /D \"_UNICODE\" /D \"UNICODE\" /FD /c " << extraDebugFlags
<< " /Zm1024" << newLine;
<< " /D " << defines << " /D \"_UNICODE\" /D \"UNICODE\" /FD /c /Zm1024 " << extraDebugFlags
<< " " << getExtraCompilerFlags().toString().trim() << newLine;
if (! isDebug)
out << "# SUBTRACT CPP /YX" << newLine;
@@ -729,8 +737,9 @@ private:
<< "kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib "
<< (isDebug ? " /debug" : "")
<< " /nologo /machine:I386 /out:\"" << targetBinary << "\" "
<< (isDLL ? "/dll" : (project.isCommandLineApp() ? "/subsystem:console"
: "/subsystem:windows")) << newLine;
<< (isDLL ? "/dll" : (project.isCommandLineApp() ? "/subsystem:console "
: "/subsystem:windows "))
<< getExtraLinkerFlags().toString().trim() << newLine;
}
}


+ 3
- 2
extras/Jucer (experimental)/Source/model/jucer_ProjectExport_Make.h View File

@@ -184,7 +184,8 @@ private:
for (int i = 0; i < libs.size(); ++i)
out << " -l" << libs[i];
out << newLine;
out << " " << getExtraLinkerFlags().toString().trim()
<< newLine;
}
void writeConfig (OutputStream& out, const Project::BuildConfiguration& config)
@@ -207,7 +208,7 @@ private:
out << " -O" << config.getGCCOptimisationFlag() << newLine;
out << " CXXFLAGS += $(CFLAGS)" << newLine;
out << " CXXFLAGS += $(CFLAGS) " << getExtraCompilerFlags().toString().trim() << newLine;
writeLinkerFlags (out, config);


+ 6
- 0
extras/Jucer (experimental)/Source/model/jucer_ProjectExport_XCode.h View File

@@ -361,6 +361,9 @@ private:
if (project.getJuceLinkageMode() == Project::useLinkedJuce)
getLinkerFlagsForStaticLibrary (getJuceLibFile(), flags, librarySearchPaths);
flags.add (getExtraLinkerFlags().toString());
flags.removeEmptyStrings (true);
}
const StringArray getProjectSettings (const Project::BuildConfiguration& config)
@@ -390,6 +393,9 @@ private:
settings.add ("HEADER_SEARCH_PATHS = \"" + getHeaderSearchPaths (config).joinIntoString (" ") + " $(inherited)\"");
settings.add ("GCC_OPTIMIZATION_LEVEL = " + config.getGCCOptimisationFlag());
settings.add ("INFOPLIST_FILE = " + infoPlistFile.getFileName());
if (getExtraCompilerFlags().toString().isNotEmpty())
settings.add ("OTHER_CPLUSPLUSFLAGS = " + getExtraCompilerFlags().toString());
switch ((int) project.getProjectType().getValue())
{


+ 5
- 0
extras/Jucer (experimental)/Source/model/jucer_ProjectExporter.cpp View File

@@ -148,6 +148,11 @@ void ProjectExporter::createPropertyEditors (Array <PropertyComponent*>& props)
props.getLast()->setTooltip ("If you're building an RTAS, this must be the folder containing the RTAS SDK. This should be an absolute path.");
}
}
props.add (new TextPropertyComponent (getExtraCompilerFlags(), "Extra compiler flags", 2048, false));
props.getLast()->setTooltip ("Extra command-line flags to be passed to the compiler");
props.add (new TextPropertyComponent (getExtraLinkerFlags(), "Extra linker flags", 2048, false));
props.getLast()->setTooltip ("Extra command-line flags to be passed to the linker. You might want to use this for adding additional libraries");
}
const Array<RelativePath> ProjectExporter::getVSTFilesRequired() const


+ 3
- 0
extras/Jucer (experimental)/Source/model/jucer_ProjectExporter.h View File

@@ -75,6 +75,9 @@ public:
bool isRTAS() const { return (bool) project.isAudioPlugin() && (bool) project.shouldBuildRTAS().getValue(); }
bool isAU() const { return (bool) project.isAudioPlugin() && (bool) project.shouldBuildAU().getValue(); }
Value getExtraCompilerFlags() const { return getSetting ("extraCompilerFlags"); }
Value getExtraLinkerFlags() const { return getSetting ("extraLinkerFlags"); }
Array<RelativePath> juceWrapperFiles;
protected:


Loading…
Cancel
Save