Vision for the first semester of 2016

Tofu Ninja via Digitalmars-d-announce digitalmars-d-announce at puremagic.com
Wed Feb 3 16:50:43 PST 2016


On Wednesday, 3 February 2016 at 23:35:21 UTC, Tofu Ninja wrote:
> ...

Actually now that I think about it, you can do with out the 
pragma and just define something like this...

mixin template DubDependency(string dependency, string vers)
{
	// Does nothing but print a dependency
	version(Dub_Dependency){
		pragma(msg, "DubDependency: \"" ~ dependency ~ "\" \"" ~ vers ~ 
"\"");
	}
}


Then whenever you need it you just put:
mixin DubDependency!("derelict-gl3", "==1.0.12");

And to get the dependencies for a file you can just do
dmd test.d -o- -version=Dub_Dependency


More information about the Digitalmars-d-announce mailing list