list available options for --cpu, --os and --cc if the passed option is not found (#11328)
This commit is contained in:
parent
2f610d621f
commit
70fb3a93e9
3 changed files with 20 additions and 3 deletions
|
|
@ -242,12 +242,20 @@ proc nameToOS*(name: string): TSystemOS =
|
|||
return i
|
||||
result = osNone
|
||||
|
||||
proc listOSnames*(): seq[string] =
|
||||
for i in succ(osNone) .. high(TSystemOS):
|
||||
result.add OS[i].name
|
||||
|
||||
proc nameToCPU*(name: string): TSystemCPU =
|
||||
for i in succ(cpuNone) .. high(TSystemCPU):
|
||||
if cmpIgnoreStyle(name, CPU[i].name) == 0:
|
||||
return i
|
||||
result = cpuNone
|
||||
|
||||
proc listCPUnames*(): seq[string] =
|
||||
for i in succ(cpuNone) .. high(TSystemCPU):
|
||||
result.add CPU[i].name
|
||||
|
||||
proc setTargetFromSystem*(t: var Target) =
|
||||
t.hostOS = nameToOS(system.hostOS)
|
||||
t.hostCPU = nameToCPU(system.hostCPU)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue