本文整理汇总了C++中ProjectExporter::getProject方法的典型用法代码示例。如果您正苦于以下问题:C++ ProjectExporter::getProject方法的具体用法?C++ ProjectExporter::getProject怎么用?C++ ProjectExporter::getProject使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ProjectExporter
的用法示例。
在下文中一共展示了ProjectExporter::getProject方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: prepareExporter
void prepareExporter (ProjectExporter& exporter) const
{
exporter.xcodeIsBundle = true;
exporter.xcodeCreatePList = true;
exporter.xcodeFileType = "wrapper.cfbundle";
exporter.xcodeBundleExtension = ".plugin";
exporter.xcodeProductType = "com.apple.product-type.bundle";
exporter.xcodeProductInstallPath = "$(HOME)/Library/Internet Plug-Ins//";
{
XmlElement mimeTypesKey ("key");
mimeTypesKey.setText ("WebPluginMIMETypes");
XmlElement mimeTypesEntry ("dict");
const String exeName (exporter.getProject().getProjectFilenameRoot().toLowerCase());
mimeTypesEntry.createNewChildElement ("key")->setText ("application/" + exeName + "-plugin");
XmlElement* d = mimeTypesEntry.createNewChildElement ("dict");
d->createNewChildElement ("key")->setText ("WebPluginExtensions");
d->createNewChildElement ("array")
->createNewChildElement ("string")->setText (exeName);
d->createNewChildElement ("key")->setText ("WebPluginTypeDescription");
d->createNewChildElement ("string")->setText (exporter.getProject().getTitle());
exporter.xcodeExtraPListEntries.add (mimeTypesKey);
exporter.xcodeExtraPListEntries.add (mimeTypesEntry);
}
exporter.msvcTargetSuffix = ".dll";
exporter.msvcIsDLL = true;
exporter.msvcExtraPreprocessorDefs.set ("_CRT_SECURE_NO_WARNINGS", "");
exporter.makefileIsDLL = true;
}
示例2: fileShouldBeAdded
static bool fileShouldBeAdded (ProjectExporter& exporter, const var& properties)
{
if (! fileTargetMatches (exporter, properties["target"].toString()))
return false;
if (properties["RTASOnly"] && ! shouldBuildRTAS (exporter.getProject()).getValue())
return false;
if (properties["AudioUnitOnly"] && ! shouldBuildAU (exporter.getProject()).getValue())
return false;
return true;
}
示例3: createPropertyEditors
void LibraryModule::createPropertyEditors (ProjectExporter& exporter, PropertyListBuilder& props) const
{
if (isVSTPluginHost (exporter.getProject())
&& ! (moduleInfo.isPluginClient() && shouldBuildVST (exporter.getProject()).getValue()))
VSTHelpers::createVSTPathEditor (exporter, props);
if (moduleInfo.isPluginClient())
{
if (shouldBuildVST (exporter.getProject()).getValue()) VSTHelpers::createPropertyEditors (exporter, props);
if (shouldBuildRTAS (exporter.getProject()).getValue()) RTASHelpers::createPropertyEditors (exporter, props);
if (shouldBuildAAX (exporter.getProject()).getValue()) AAXHelpers::createPropertyEditors (exporter, props);
}
}
示例4: addBrowsableCode
void LibraryModule::addBrowsableCode (ProjectExporter& exporter, ProjectSaver& projectSaver,
const Array<File>& compiled, const File& localModuleFolder) const
{
if (sourceFiles.size() == 0)
findBrowseableFiles (localModuleFolder, sourceFiles);
Project::Item sourceGroup (Project::Item::createGroup (exporter.getProject(), getID(), "__mainsourcegroup" + getID()));
const RelativePath moduleFromProject (exporter.getModuleFolderRelativeToProject (getID(), projectSaver));
for (int i = 0; i < sourceFiles.size(); ++i)
{
const String pathWithinModule (FileHelpers::getRelativePathFrom (sourceFiles.getReference(i), localModuleFolder));
// (Note: in exporters like MSVC we have to avoid adding the same file twice, even if one of those instances
// is flagged as being excluded from the build, because this overrides the other and it fails to compile)
if (exporter.canCopeWithDuplicateFiles() || ! compiled.contains (sourceFiles.getReference(i)))
addFileWithGroups (sourceGroup,
moduleFromProject.getChildFile (pathWithinModule),
pathWithinModule);
}
sourceGroup.addFile (localModuleFolder.getChildFile (FileHelpers::getRelativePathFrom (moduleInfo.manifestFile,
moduleInfo.getFolder())), -1, false);
sourceGroup.addFile (getModuleHeaderFile (localModuleFolder), -1, false);
exporter.getModulesGroup().state.addChild (sourceGroup.state.createCopy(), -1, nullptr);
}
示例5: addSettingsForModuleToExporter
void LibraryModule::addSettingsForModuleToExporter (ProjectExporter& exporter, ProjectSaver& projectSaver) const
{
Project& project = exporter.getProject();
RelativePath modulePath = exporter.getModuleFolderRelativeToProject (getID());
exporter.addToExtraSearchPaths (modulePath.getParentDirectory());
const String extraInternalSearchPaths (moduleInfo.getExtraSearchPaths().trim());
if (extraInternalSearchPaths.isNotEmpty())
{
StringArray paths;
paths.addTokens (extraInternalSearchPaths, true);
for (int i = 0; i < paths.size(); ++i)
exporter.addToExtraSearchPaths (modulePath.getChildFile (paths.getReference(i)));
}
{
const String extraDefs (moduleInfo.getPreprocessorDefs().trim());
if (extraDefs.isNotEmpty())
exporter.getExporterPreprocessorDefs() = exporter.getExporterPreprocessorDefsString() + "\n" + extraDefs;
}
{
Array<File> compiled;
const File localModuleFolder = project.getModules().shouldCopyModuleFilesLocally (getID()).getValue()
? project.getLocalModuleFolder (getID())
: moduleInfo.getFolder();
findAndAddCompiledUnits (exporter, &projectSaver, compiled);
if (project.getModules().shouldShowAllModuleFilesInProject (getID()).getValue())
addBrowseableCode (exporter, compiled, localModuleFolder);
}
if (exporter.isXcode())
{
XCodeProjectExporter& xcodeExporter = dynamic_cast<XCodeProjectExporter&> (exporter);
if (project.isAUPluginHost())
xcodeExporter.xcodeFrameworks.addTokens ("AudioUnit CoreAudioKit", false);
const String frameworks (moduleInfo.moduleInfo [xcodeExporter.isOSX() ? "OSXFrameworks" : "iOSFrameworks"].toString());
xcodeExporter.xcodeFrameworks.addTokens (frameworks, ", ", StringRef());
parseAndAddLibs (xcodeExporter.xcodeLibs, moduleInfo.moduleInfo [exporter.isOSX() ? "OSXLibs" : "iOSLibs"].toString());
}
else if (exporter.isLinux())
{
parseAndAddLibs (exporter.linuxLibs, moduleInfo.moduleInfo ["linuxLibs"].toString());
}
else if (exporter.isCodeBlocks() && exporter.isWindows())
{
parseAndAddLibs (exporter.mingwLibs, moduleInfo.moduleInfo ["mingwLibs"].toString());
}
}
示例6: prepareExporter
//==============================================================================
void LibraryModule::prepareExporter (ProjectExporter& exporter, ProjectSaver& projectSaver) const
{
Project& project = exporter.getProject();
exporter.addToExtraSearchPaths (exporter.getModuleFolderRelativeToProject (getID(), projectSaver).getParentDirectory());
const String extraDefs (moduleInfo.getPreprocessorDefs().trim());
if (extraDefs.isNotEmpty())
exporter.getExporterPreprocessorDefs() = exporter.getExporterPreprocessorDefsString() + "\n" + extraDefs;
{
Array<File> compiled;
const File localModuleFolder = project.getModules().shouldCopyModuleFilesLocally (getID()).getValue()
? projectSaver.getLocalModuleFolder (getID())
: moduleInfo.getFolder();
findAndAddCompiledCode (exporter, projectSaver, localModuleFolder, compiled);
if (project.getModules().shouldShowAllModuleFilesInProject (getID()).getValue())
addBrowsableCode (exporter, projectSaver, compiled, moduleInfo.getFolder());
}
if (isVSTPluginHost (project))
VSTHelpers::addVSTFolderToPath (exporter, exporter.extraSearchPaths);
if (exporter.isXcode())
{
if (isAUPluginHost (project))
exporter.xcodeFrameworks.addTokens ("AudioUnit CoreAudioKit", false);
const String frameworks (moduleInfo.moduleInfo [exporter.isOSX() ? "OSXFrameworks" : "iOSFrameworks"].toString());
exporter.xcodeFrameworks.addTokens (frameworks, ", ", String::empty);
}
else if (exporter.isLinux())
{
const String libs (moduleInfo.moduleInfo ["LinuxLibs"].toString());
exporter.linuxLibs.addTokens (libs, ", ", String::empty);
exporter.linuxLibs.trim();
exporter.linuxLibs.sort (false);
exporter.linuxLibs.removeDuplicates (false);
}
else if (exporter.isCodeBlocks())
{
const String libs (moduleInfo.moduleInfo ["mingwLibs"].toString());
exporter.mingwLibs.addTokens (libs, ", ", String::empty);
exporter.mingwLibs.trim();
exporter.mingwLibs.sort (false);
exporter.mingwLibs.removeDuplicates (false);
}
if (moduleInfo.isPluginClient())
{
if (shouldBuildVST (project).getValue()) VSTHelpers::prepareExporter (exporter, projectSaver);
if (shouldBuildAU (project).getValue()) AUHelpers::prepareExporter (exporter, projectSaver);
if (shouldBuildAAX (project).getValue()) AAXHelpers::prepareExporter (exporter, projectSaver);
if (shouldBuildRTAS (project).getValue()) RTASHelpers::prepareExporter (exporter, projectSaver);
}
}
示例7: addBrowseableCode
void LibraryModule::addBrowseableCode (ProjectExporter& exporter, const Array<File>& compiled, const File& localModuleFolder) const
{
if (sourceFiles.isEmpty())
findBrowseableFiles (localModuleFolder, sourceFiles);
Project::Item sourceGroup (Project::Item::createGroup (exporter.getProject(), getID(), "__mainsourcegroup" + getID(), false));
const RelativePath moduleFromProject (exporter.getModuleFolderRelativeToProject (getID()));
auto moduleHeader = moduleInfo.getHeader();
for (auto& sourceFile : sourceFiles)
{
auto pathWithinModule = FileHelpers::getRelativePathFrom (sourceFile, localModuleFolder);
// (Note: in exporters like MSVC we have to avoid adding the same file twice, even if one of those instances
// is flagged as being excluded from the build, because this overrides the other and it fails to compile)
if ((exporter.canCopeWithDuplicateFiles() || ! compiled.contains (sourceFile)) && sourceFile != moduleHeader)
addFileWithGroups (sourceGroup,
moduleFromProject.getChildFile (pathWithinModule),
pathWithinModule);
}
sourceGroup.sortAlphabetically (true, true);
sourceGroup.addFileAtIndex (moduleHeader, -1, false);
exporter.getModulesGroup().state.addChild (sourceGroup.state.createCopy(), -1, nullptr);
}
示例8: findAndAddCompiledUnits
void LibraryModule::findAndAddCompiledUnits (ProjectExporter& exporter,
ProjectSaver* projectSaver,
Array<File>& result,
ProjectType::Target::Type forTarget) const
{
for (auto& cu : getAllCompileUnits (forTarget))
{
if (cu.isNeededForExporter (exporter))
{
auto localFile = exporter.getProject().getGeneratedCodeFolder()
.getChildFile (cu.getFilenameForProxyFile());
result.add (localFile);
if (projectSaver != nullptr)
projectSaver->addFileToGeneratedGroup (localFile);
}
}
}
示例9: findAndAddCompiledUnits
void LibraryModule::findAndAddCompiledUnits (ProjectExporter& exporter,
ProjectSaver* projectSaver,
Array<File>& result) const
{
Array<CompileUnit> units = getAllCompileUnits();
for (int i = 0; i < units.size(); ++i)
{
const CompileUnit& cu = units.getReference(i);
if (cu.isNeededForExporter (exporter))
{
File localFile = exporter.getProject().getGeneratedCodeFolder().getChildFile (cu.file.getFileName());
result.add (localFile);
if (projectSaver != nullptr)
projectSaver->addFileToGeneratedGroup (localFile);
}
}
}
示例10:
bool LibraryModule::CompileUnit::isNeededForExporter (ProjectExporter& exporter) const
{
Project& project = exporter.getProject();
if ((hasSuffix (file, "_OSX") && ! exporter.isOSX())
|| (hasSuffix (file, "_iOS") && ! exporter.isiOS())
|| (hasSuffix (file, "_Windows") && ! exporter.isWindows())
|| (hasSuffix (file, "_Linux") && ! exporter.isLinux())
|| (hasSuffix (file, "_Android") && ! exporter.isAndroid())
|| (hasSuffix (file, "_AU") && ! (project.shouldBuildAU() .getValue() && exporter.supportsAU()))
|| (hasSuffix (file, "_AUv3") && ! (project.shouldBuildAUv3().getValue() && exporter.supportsAUv3()))
|| (hasSuffix (file, "_AAX") && ! (project.shouldBuildAAX() .getValue() && exporter.supportsAAX()))
|| (hasSuffix (file, "_RTAS") && ! (project.shouldBuildRTAS().getValue() && exporter.supportsRTAS()))
|| (hasSuffix (file, "_VST2") && ! (project.shouldBuildVST() .getValue() && exporter.supportsVST()))
|| (hasSuffix (file, "_VST3") && ! (project.shouldBuildVST3().getValue() && exporter.supportsVST3()))
|| (hasSuffix (file, "_Standalone") && ! (project.shouldBuildStandalone().getValue() && exporter.supportsStandalone())))
return false;
return exporter.usesMMFiles() ? isCompiledForObjC
: isCompiledForNonObjC;
}
示例11: addSettingsForModuleToExporter
void LibraryModule::addSettingsForModuleToExporter (ProjectExporter& exporter, ProjectSaver& projectSaver) const
{
auto& project = exporter.getProject();
const auto moduleRelativePath = exporter.getModuleFolderRelativeToProject (getID());
exporter.addToExtraSearchPaths (moduleRelativePath.getParentDirectory());
String libDirPlatform;
if (exporter.isLinux())
libDirPlatform = "Linux";
else if (exporter.isCodeBlocks() && exporter.isWindows())
libDirPlatform = "MinGW";
else
libDirPlatform = exporter.getTargetFolder().getFileName();
const auto libSubdirPath = String (moduleRelativePath.toUnixStyle() + "/libs/") + libDirPlatform;
const auto moduleLibDir = File (project.getProjectFolder().getFullPathName() + "/" + libSubdirPath);
if (moduleLibDir.exists())
exporter.addToModuleLibPaths (RelativePath (libSubdirPath, moduleRelativePath.getRoot()));
const auto extraInternalSearchPaths = moduleInfo.getExtraSearchPaths().trim();
if (extraInternalSearchPaths.isNotEmpty())
{
StringArray paths;
paths.addTokens (extraInternalSearchPaths, true);
for (int i = 0; i < paths.size(); ++i)
exporter.addToExtraSearchPaths (moduleRelativePath.getChildFile (paths.getReference(i)));
}
{
const String extraDefs (moduleInfo.getPreprocessorDefs().trim());
if (extraDefs.isNotEmpty())
exporter.getExporterPreprocessorDefs() = exporter.getExporterPreprocessorDefsString() + "\n" + extraDefs;
}
{
Array<File> compiled;
auto& modules = project.getModules();
auto id = getID();
const File localModuleFolder = modules.shouldCopyModuleFilesLocally (id).getValue()
? project.getLocalModuleFolder (id)
: moduleInfo.getFolder();
findAndAddCompiledUnits (exporter, &projectSaver, compiled);
if (modules.shouldShowAllModuleFilesInProject (id).getValue())
addBrowseableCode (exporter, compiled, localModuleFolder);
}
if (exporter.isXcode())
{
auto& xcodeExporter = dynamic_cast<XcodeProjectExporter&> (exporter);
if (project.isAUPluginHost())
xcodeExporter.xcodeFrameworks.addTokens (xcodeExporter.isOSX() ? "AudioUnit CoreAudioKit" : "CoreAudioKit", false);
const String frameworks (moduleInfo.moduleInfo [xcodeExporter.isOSX() ? "OSXFrameworks" : "iOSFrameworks"].toString());
xcodeExporter.xcodeFrameworks.addTokens (frameworks, ", ", {});
parseAndAddLibs (xcodeExporter.xcodeLibs, moduleInfo.moduleInfo [exporter.isOSX() ? "OSXLibs" : "iOSLibs"].toString());
}
else if (exporter.isLinux())
{
parseAndAddLibs (exporter.linuxLibs, moduleInfo.moduleInfo ["linuxLibs"].toString());
parseAndAddLibs (exporter.linuxPackages, moduleInfo.moduleInfo ["linuxPackages"].toString());
}
else if (exporter.isWindows())
{
if (exporter.isCodeBlocks())
parseAndAddLibs (exporter.mingwLibs, moduleInfo.moduleInfo ["mingwLibs"].toString());
else
parseAndAddLibs (exporter.windowsLibs, moduleInfo.moduleInfo ["windowsLibs"].toString());
}
else if (exporter.isAndroid())
{
parseAndAddLibs (exporter.androidLibs, moduleInfo.moduleInfo ["androidLibs"].toString());
}
}