mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
builder: allow for -os windows -cc msvc -o x.c
on any platform
This commit is contained in:
parent
fbf6910ab9
commit
daa659e1fd
@ -46,7 +46,7 @@ pub fn (mut b Builder) build_c(v_files []string, out_file string) {
|
||||
}
|
||||
|
||||
pub fn (mut b Builder) compile_c() {
|
||||
if os.user_os() != 'windows' && b.pref.ccompiler == 'msvc' {
|
||||
if os.user_os() != 'windows' && b.pref.ccompiler == 'msvc' && !b.pref.out_name.ends_with('.c') {
|
||||
verror('Cannot build with msvc on $os.user_os()')
|
||||
}
|
||||
// cgen.genln('// Generated by V')
|
||||
|
@ -181,7 +181,12 @@ fn find_msvc() ?MsvcResult {
|
||||
valid: true
|
||||
}
|
||||
} $else {
|
||||
return error('msvc not found')
|
||||
// This hack allows to at least see the generated .c file with `-os windows -cc msvc -o x.c`
|
||||
// Please do not remove it, unless you also check that the above continues to work.
|
||||
return MsvcResult{
|
||||
full_cl_exe_path: '/usr/bin/true'
|
||||
valid: true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user