mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-02-04 05:53:13 +01:00
Merged xfBuild patch for dependency tree generation. See #286.
This commit is contained in:
21
gen/main.cpp
21
gen/main.cpp
@@ -143,7 +143,9 @@ int main(int argc, char** argv)
|
||||
global.params.libfiles = new Array();
|
||||
global.params.objfiles = new Array();
|
||||
global.params.ddocfiles = new Array();
|
||||
|
||||
|
||||
global.params.moduleDeps = NULL;
|
||||
global.params.moduleDepsFile = NULL;
|
||||
|
||||
// Set predefined version identifiers
|
||||
VersionCondition::addPredefinedGlobalIdent("LLVM");
|
||||
@@ -222,6 +224,12 @@ int main(int argc, char** argv)
|
||||
global.params.hdrdir || global.params.hdrname;
|
||||
#endif
|
||||
|
||||
initFromString(global.params.moduleDepsFile, moduleDepsFile);
|
||||
if (global.params.moduleDepsFile != NULL)
|
||||
{
|
||||
global.params.moduleDeps = new OutBuffer;
|
||||
}
|
||||
|
||||
processVersions(debugArgs, "debug",
|
||||
DebugCondition::setGlobalLevel,
|
||||
DebugCondition::addGlobalIdent);
|
||||
@@ -830,6 +838,17 @@ int main(int argc, char** argv)
|
||||
if (global.errors)
|
||||
fatal();
|
||||
|
||||
// write module dependencies to file if requested
|
||||
if (global.params.moduleDepsFile != NULL)
|
||||
{
|
||||
assert (global.params.moduleDepsFile != NULL);
|
||||
|
||||
File deps(global.params.moduleDepsFile);
|
||||
OutBuffer* ob = global.params.moduleDeps;
|
||||
deps.setbuffer((void*)ob->data, ob->offset);
|
||||
deps.write();
|
||||
}
|
||||
|
||||
// collects llvm modules to be linked if singleobj is passed
|
||||
std::vector<llvm::Module*> llvmModules;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user