@@ -12,14 +12,24 @@ OS osFromArch(string arch)
1212{
1313 import std.string ;
1414 static bool contains (string a, string b){return a.indexOf(b) != - 1 ;}
15+
16+ if (arch is null ) return std.system.os ;
17+
1518 if (contains(arch, " x86_64-windows" )) return OS .win64;
1619 else if (contains(arch, " i686-windows" )) return OS .win32;
1720 else if (contains(arch, " android" )) return OS .android;
1821 else if (contains(arch, " linux" )) return OS .linux;
1922 else if (contains(arch, " macos" )) return OS .osx;
2023 else if (contains(arch, " ios" )) return OS .iOS;
21- else if (contains(arch, " wasm32" )) return OS .otherPosix;
22- else return std.system.os ;
24+ else if (contains(arch, " tvos" )) return OS .tvOS;
25+ else if (contains(arch, " watchos" )) return OS .watchOS;
26+ else if (contains(arch, " freebsd" )) return OS .freeBSD;
27+ else if (contains(arch, " netbsd" )) return OS .netBSD;
28+ else if (contains(arch, " openbsd" )) return OS .openBSD;
29+ else if (contains(arch, " solaris" )) return OS .solaris;
30+ else if (contains(arch, " posix" )) return OS .otherPosix;
31+
32+ return OS .unknown;
2333}
2434
2535ISA isaFromArch (string arch)
@@ -228,7 +238,7 @@ void copyDir(string fromDir, string toDir, bool shallow = true)
228238string getOutputName (TargetType t, string name, OS os, ISA isa = std.system.instructionSetArchitecture )
229239{
230240 string outputName = name;
231- if (os.isPosix && t.isAnyLibrary)
241+ if (! os.isWindows && t.isAnyLibrary)
232242 {
233243 import std.path ;
234244 import std.string ;
0 commit comments