Code works good on Win 32, but at start on Win 64 I got:

Exception code: 0xc0000005
Fault offset: 0x00000000000132c5

void main(string[] args)
{
    auto workDir = "build_tmp";
    auto currDir = getcwd();
    string[] src;
    string[] obj;
    string cfg = "build.json";
    Compiler compiler;
    DirEntry[] files;

    if (args.length > 1 && !args[1].empty)
        if (exists(args[1]))
            cfg = args[1];

    try
    {
        compiler = cfg.readCompilerInfo();
    }
    catch (Exception e)
    {
        writeln(e.msg);
    }

    if (compiler is null)
        return;

    if (!exists(compiler.srcDestination))
    {
        writeln("Not found: <" ~ compiler.srcDestination ~ ">.");
        return;
    }

files = dirEntries(compiler.srcDestination, "*.d", SpanMode.depth).array;

    if (files is null)
    {
        writeln("No sources.");
        return;
    }

    foreach(f; files)
    {
        src ~= absolutePath(f.name);
obj ~= buildNormalizedPath(workDir, setExtension(f.name, "obj"));
    }

    for (size_t i = 0; i < src.length; i ++)
    {
        if (!obj[i].dirName().exists())
            obj[i].dirName().mkdirRecurse();

        compiler.compile(src[i], obj[i]).executeInShell();
    }

    compiler.build(obj).executeInShell();
}

Reply via email to