Skip to content

Instantly share code, notes, and snippets.

@s-ludwig
Created December 11, 2013 18:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save s-ludwig/7916080 to your computer and use it in GitHub Desktop.
Save s-ludwig/7916080 to your computer and use it in GitHub Desktop.
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