On 10/26/2014 11:27 PM, Robert burner Schadek wrote:
it is not really a dependency as the one template that uses the version
identifier uses them optionally.

It simply doesn't work, e.g. you could not statically disable logging in phobos without recompiling phobos.

cat > lib.d << CODE
version (StdLoggerDisableLogging)
    enum isLoggingActive = false;
else
    enum isLoggingActive = true;

void doSome()
{
    import std.stdio;
    writeln("isLoggingActive: ", isLoggingActive);
}
CODE

cat > main.d << CODE
import lib, std.stdio;

void main()
{
    writeln("isLoggingActive: ", isLoggingActive);
    doSome();
}
CODE

dmd -version=StdLoggerDisableLogging -lib lib.d
dmd main lib.a
./main

Reply via email to