本文整理汇总了C++中Archiver::create方法的典型用法代码示例。如果您正苦于以下问题:C++ Archiver::create方法的具体用法?C++ Archiver::create怎么用?C++ Archiver::create使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Archiver
的用法示例。
在下文中一共展示了Archiver::create方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: createStaticLibrary
void createStaticLibrary(CCompiler<Base>& compiler,
Archiver& ar,
bool posIndepCode) {
// backup output format so that it can be restored
OStreamConfigRestore coutb(std::cout);
this->modelLibraryHelper_->startingJob("", JobTimer::STATIC_MODEL_LIBRARY);
const std::map<std::string, ModelCSourceGen<Base>*>& models = this->modelLibraryHelper_->getModels();
try {
for (const auto& p : models) {
const std::map<std::string, std::string>& modelSources = this->getSources(*p.second);
this->modelLibraryHelper_->startingJob("", JobTimer::COMPILING_FOR_MODEL);
compiler.compileSources(modelSources, posIndepCode, this->modelLibraryHelper_);
this->modelLibraryHelper_->finishedJob();
}
const std::map<std::string, std::string>& sources = this->getLibrarySources();
compiler.compileSources(sources, posIndepCode, this->modelLibraryHelper_);
const std::map<std::string, std::string>& customSource = this->modelLibraryHelper_->getCustomSources();
compiler.compileSources(customSource, posIndepCode, this->modelLibraryHelper_);
std::string libname = _libraryName;
if (_customLibExtension != nullptr)
libname += *_customLibExtension;
else
libname += system::SystemInfo<>::STATIC_LIB_EXTENSION;
ar.create(libname, compiler.getObjectFiles(), this->modelLibraryHelper_);
} catch (...) {
compiler.cleanup();
throw;
}
compiler.cleanup();
this->modelLibraryHelper_->finishedJob();
}