Build library files of dependent projects in .dub/lib for generated VisualD projects.
1 parent ba582d6 commit 9af364e144122a4fd2e6ffdf89a29b0cdf5ffb52
@Sönke Ludwig Sönke Ludwig authored on 13 Apr 2013
Showing 1 changed file
View
6
source/dub/generators/visuald.d
 
// Lib or exe?
bool is_lib = pbuildsettings.targetType != TargetType.executable;
string debugSuffix = type == Config.Debug? "_d" : "";
auto bin_path = Path(pbuildsettings.targetPath);
auto bin_path = pack is m_app.mainPackage ? Path(pbuildsettings.targetPath) : Path(".dub/lib/");
bin_path.endsWithSlash = true;
ret.formattedWrite("
<lib>%s</lib>
<exefile>%s%s%s.%s</exefile>", is_lib ? "1" : "0", bin_path.toNativeString(), pbuildsettings.targetName, debugSuffix, is_lib ? "lib" : "exe");
auto relpackpath = pack.path.relativeTo(m_app.mainPackage.path);
uint ndummy = 0;
foreach (i; 0 .. relpackpath.length)
if (pack.path[i] == "..") ndummy++;
string intersubdir = (ndummy*2 > relpackpath.length ? replicate("dummy/", ndummy*2-relpackpath.length) : "") ~ "/" ~ pack.name;
string intersubdir = (ndummy*2 > relpackpath.length ? replicate("dummy/", ndummy*2-relpackpath.length) : "") ~ pack.name;
// Not yet dynamic stuff
ret.formattedWrite("
<obj>0</obj>
<Dversion>2</Dversion>
<ignoreUnsupportedPragmas>0</ignoreUnsupportedPragmas>
<compiler>0</compiler>
<otherDMD>0</otherDMD>
<outdir>$(ConfigurationName)</outdir>
");
ret.formattedWrite(" <outdir>%s</outdir>\n", bin_path.toNativeString());
ret.formattedWrite(" <objdir>.dub/obj/%s</objdir>\n", intersubdir);
ret.formattedWrite("%s",
" <objname />
<libname />