1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

Revert "Revert "compiler: support setting pref.output_cross_c with -os cross""

This reverts commit ba85b8d024.
This commit is contained in:
Delyan Angelov 2020-04-23 22:46:29 +03:00
parent ba85b8d024
commit 1d9d9757cf

View File

@ -170,14 +170,17 @@ fn parse_args(args []string) (&pref.Preferences, string) {
res.backend = .x64
}
'-os' {
// TODO Remove `tmp` variable when it doesn't error out in C.
target_os := cmdline.option(current_args, '-os', '')
tmp := pref.os_from_string(target_os) or {
i++
target_os_kind := pref.os_from_string(target_os) or {
if target_os == 'cross' {
res.output_cross_c = true
continue
}
println('unknown operating system target `$target_os`')
exit(1)
}
res.os = tmp
i++
res.os = target_os_kind
}
'-cflags' {
res.cflags = cmdline.option(current_args, '-cflags', '')