diff --git a/Makefile b/Makefile index 7a0f73e2e65..65c252451ff 100644 --- a/Makefile +++ b/Makefile @@ -337,6 +337,7 @@ else unittest : unittest-debug unittest-release unittest-%: $(MAKE) unittest OS=$(OS) MODEL=$(MODEL) DMD=$(DMD) BUILD=$* + DMD=$(DMD) $(DMD) -run build_v3.d unittest-$* endif ################################################################################ diff --git a/build_v3.d b/build_v3.d index 83c9be57bcd..f533bdf8362 100755 --- a/build_v3.d +++ b/build_v3.d @@ -3,7 +3,10 @@ Phobos V3 Build Script Usage: - ./build_v3.d [debug,release,unittest] + ./build_v3.d [debug|release|unittest|unittest-debug|unittest-release] + +Environment Variables: + DMD=[/path/to/compiler] */ import std.conv; @@ -18,12 +21,23 @@ int main(string[] args) { int result = 0; + immutable compiler = environment.get("DMD", "dmd").buildNormalizedPath(); + bool buildUnittest = false; bool buildRelease = false; - if (args.length > 1) + + if(args.length > 1) { - buildUnittest = args[1] == "unittest"; - buildRelease = args[1] == "release"; + switch(args[1]) + { + case "release": buildRelease = true; break; + // This should be changed to run the tests in both debug and release + // modes, but that's a larger change. + case "unittest": buildUnittest = true; break; + case "unittest-debug": buildUnittest = true; break; + case "unittest-release": buildUnittest = true; goto case "release"; + default: break; + } } string argFilePath = buildNormalizedPath(getcwd(), "phobosbuildargs.txt"); @@ -47,7 +61,7 @@ int main(string[] args) if (exists(unittestExecutable)) remove(unittestExecutable); } - result = runCommand("dmd --version", getcwd()); + result = runCommand(format("%s --version", compiler), getcwd()); if (result != 0) { writeln("Compiler Failure."); @@ -69,7 +83,6 @@ int main(string[] args) { argFile.writeln("-main"); argFile.writeln("-unittest"); - argFile.writeln("-debug"); version(Windows) { @@ -80,24 +93,19 @@ int main(string[] args) argFile.writeln("-of=unittest"); } } - else if (buildRelease) - { - argFile.writeln("-release -O"); - argFile.writeln("-lib"); - argFile.writeln("-of=libphobos3"); - } else { - argFile.writeln("-debug"); argFile.writeln("-lib"); - argFile.writeln("-of=libphobos3-debug"); + argFile.writefln("-of=libphobos3%s", buildRelease ? "" : "-debug"); } + argFile.writeln(buildRelease ? "-release -O" : "-debug"); + argFile.flush(); argFile.close(); //Run the build. - result = runCommand("dmd @\"" ~ argFilePath ~ "\"", getcwd()); + result = runCommand(format(`%s @"%s"`, compiler, argFilePath), getcwd()); if (result != 0) { writeln("Build failed."); diff --git a/phobos/sys/meta.d b/phobos/sys/meta.d index 1c31b67a72f..2b127d90e73 100644 --- a/phobos/sys/meta.d +++ b/phobos/sys/meta.d @@ -435,14 +435,13 @@ private template AppendIfUnique(alias Cmp, Args...) /// @safe unittest { - alias Types = AliasSeq!(int, uint, long, string, short, int*, ushort); + alias Types = AliasSeq!(int, uint, long, short, int*, ushort); template sameSize(T) { enum sameSize(U) = T.sizeof == U.sizeof; } - static assert(is(Unique!(sameSize, Types) == - AliasSeq!(int, long, string, short))); + static assert(is(Unique!(sameSize, Types) == AliasSeq!(int, long, short))); // The predicate must be partially instantiable. enum sameSize_fails(T, U) = T.sizeof == U.sizeof;