Skip to content

Commit

Permalink
Get rid of OS specific file path separators
Browse files Browse the repository at this point in the history
as suggested by @linkrope in #17 (comment).
Not tested yet on Windows as locally not available, currently. Runs wel on Linux.
  • Loading branch information
kuniss committed Jan 4, 2024
1 parent ae44c3e commit de88bc1
Showing 1 changed file with 6 additions and 13 deletions.
19 changes: 6 additions & 13 deletions src/gamma/main.d
Original file line number Diff line number Diff line change
Expand Up @@ -230,29 +230,22 @@ void build(string[] fileNames, string outputDirectory)
{
import core.stdc.stdlib : exit;
import std.format : format;
import std.path : stripExtension;
import std.path : buildPath, stripExtension;
import std.process : spawnProcess, wait;
import std.string : join;

auto args = "dmd" ~ fileNames ~ "-g" ~ "include/runtime.d"
~ "src/io.d" ~ "src/log.d" ~ "src/epsilon/soag/listacks.d";
auto args = "dmd" ~ fileNames ~ "-g"
~ buildPath("include", "runtime.d")
~ buildPath("src", "io.d")
~ buildPath("src", "log.d")
~ buildPath("src", "epsilon", "soag", "listacks.d");

if (!outputDirectory.empty)
{
args ~= format!"-od=%s"(outputDirectory);
args ~= format!"-of=%s"(fileNames.front.stripExtension.executableName);
}

version(Windows)
{
import std.string : translate;
for(int i; i < args.length; i++)
{
dchar[dchar] translation = ['/': '\\'];
args[i] = translate(args[i], translation);
}
}

info!"%s"(args.join(' '));

auto pid = spawnProcess(args);
Expand Down

0 comments on commit de88bc1

Please sign in to comment.