You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// rumor has it arm64 for apple can be better than aarch64 but i think they the same
@@ -37,9 +37,9 @@ import std.file;
37
37
// edit and test by module name instead of by file name
38
38
39
39
string[] testRunnerBuildArgs(string[] userArgs) {
40
-
auto args = ["-g", "-oftest_runner", "-unittest", "-checkaction=context", "-version=OD_TestRunner", getBundledModulePath("odc.test_runner")];
41
-
args ~= userArgs;
42
-
return args;
40
+
auto args = ["-g", "-oftest_runner", "-unittest", "-checkaction=context", "-version=OD_TestRunner", getBundledModulePath("odc.test_runner")];
41
+
args ~= userArgs;
42
+
return args;
43
43
}
44
44
45
45
string preferredCompiler;
@@ -75,9 +75,9 @@ int main(string[] args) {
75
75
case"compiler":
76
76
preferredCompiler = value;
77
77
break;
78
-
case"dev":
79
-
devCompiler = true;
80
-
break;
78
+
case"dev":
79
+
devCompiler = true;
80
+
break;
81
81
default:
82
82
thrownewException("unknown opend arg: "~ name);
83
83
}
@@ -297,6 +297,21 @@ struct Commands {
297
297
return0;
298
298
}
299
299
300
+
intprocessIcon(string filename) {
301
+
// FIXME: error if target is not windows prolly here instead of in the compiler
302
+
// gotta create a Windows resource file. this means:
303
+
/+
304
+
1) if it is a png, convert to ico. ico can be used directly. other formats not supported by simplifiying choice
305
+
2) concat this into a .res file (can skip if unnecessary via timestamps or something but it cheap enough tbh. user can aksi use the .res externally directly if they want)
306
+
2a) res file just has a header https://learn.microsoft.com/en-us/windows/win32/menurc/resourceheader
307
+
2b) other resource file features maybe usable later but for now just doing the one,
308
+
3) pass this file to the linker
309
+
+/
310
+
//
311
+
argsToKeep ~= filename ~".res";
312
+
return0;
313
+
}
314
+
300
315
inttranslateTarget(string target) {
301
316
importstd.string;
302
317
@@ -305,8 +320,24 @@ struct Commands {
305
320
string cpu;
306
321
string detail;
307
322
323
+
string[] moreArgs;
324
+
325
+
string implicitTarget;
326
+
version(Windows)
327
+
implicitTarget = "windows";
328
+
329
+
stringcurrentTargetOs() {
330
+
return os.length ? os : implicitTarget;
331
+
}
332
+
308
333
foreach(part; target.toLower.split("-")) {
309
334
switch(part) {
335
+
case"gui":
336
+
if(currentTargetOs =="windows") {
337
+
moreArgs ~="-L/subsystem:windows";
338
+
moreArgs ~="-L/entry:mainCRTStartup";
339
+
}
340
+
break;
310
341
case"windows":
311
342
case"win64":
312
343
cpu = "x86_64";
@@ -342,18 +373,18 @@ struct Commands {
342
373
os = "linux";
343
374
detail = "gnu";
344
375
break;
345
-
case"gnu.2.17":
346
-
case"compat":
347
-
case"compatible":
348
-
// pick a glibc that is more likely to be compatible when distributed
349
-
if(auto r = warnAboutXpack("xpack-zig"))
350
-
return r;
376
+
case"gnu.2.17":
377
+
case"compat":
378
+
case"compatible":
379
+
// pick a glibc that is more likely to be compatible when distributed
380
+
if(auto r = warnAboutXpack("xpack-zig"))
381
+
return r;
351
382
352
383
if(cpu isnull)
353
384
cpu = "x86_64";
354
385
os = "linux";
355
386
detail = "gnu.2.17";
356
-
break;
387
+
break;
357
388
case"arm":
358
389
case"aarch64":
359
390
cpu = "aarch64";
@@ -363,14 +394,14 @@ struct Commands {
363
394
case"intel":
364
395
cpu = "x86_64";
365
396
break;
366
-
case"rpi":
367
-
// shortcut for raspberry pi: linux-aarch64-gnu.2.17 via zigcc
368
-
if(auto r = warnAboutXpack("xpack-rpi"))
369
-
return r;
370
-
os = "linux";
371
-
cpu = "aarch64";
372
-
detail = "gnu.2.17";
373
-
break;
397
+
case"rpi":
398
+
// shortcut for raspberry pi: linux-aarch64-gnu.2.17 via zigcc
0 commit comments