Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move application code for static ctor in main module #2730

Merged
merged 1 commit into from
Dec 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions source/app.d
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,20 @@ module app;

import dub.commandline;

// Set output path and options for coverage reports
version (DigitalMars) version (D_Coverage)
{
shared static this()
{
import core.runtime, std.file, std.path, std.stdio;
dmd_coverSetMerge(true);
auto path = buildPath(dirName(thisExePath()), "../cov");
if (!path.exists)
mkdir(path);
dmd_coverDestPath(path);
}
}

/**
* Workaround https://github.com/dlang/dub/issues/1812
*
Expand Down
14 changes: 0 additions & 14 deletions source/dub/dub.d
Original file line number Diff line number Diff line change
Expand Up @@ -33,20 +33,6 @@ import std.process : environment;
import std.range : assumeSorted, empty;
import std.string;

// Set output path and options for coverage reports
version (DigitalMars) version (D_Coverage)
{
shared static this()
{
import core.runtime, std.file, std.path, std.stdio;
dmd_coverSetMerge(true);
auto path = buildPath(dirName(thisExePath()), "../cov");
if (!path.exists)
mkdir(path);
dmd_coverDestPath(path);
}
}

static this()
{
import dub.compilers.dmd : DMDCompiler;
Expand Down
Loading