Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Workaround for linking to a DUB dependency instead of compiling it together with the application source code.
{
"name": "myapp",
"dependencies": {
"mylib": "~master"
},
"subConfigurations": {
"mylib": "import"
}
}
import std.stdio;
import lib;
void main()
{
hello();
}
{
"name": "mylib",
"configurations": [
{
"name": "library",
"targetType": "library",
"sourcePaths": ["source/"],
"importPaths": ["source/"]
},
{
"name": "import",
"targetType": "sourceLibrary",
"importPaths": ["source/"],
"sourceFiles-windows": ["mylib.lib"],
"sourceFiles-posix": ["libmylib.a"]
}
]
}
import std.stdio;
void hello()
{
writefln("Hello, World!");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment