compiler: pass -cflags to thirdparty building stage too

pull/2068/head
Delyan Angelov 2019-09-22 10:56:02 +03:00 committed by Alexander Medvednikov
parent cec2173381
commit 049e228003
2 changed files with 18 additions and 17 deletions

View File

@ -369,17 +369,23 @@ fn find_c_compiler_default() string {
} }
fn find_c_compiler_thirdparty_options() string { fn find_c_compiler_thirdparty_options() string {
if '-m32' in os.args{ fullargs := env_vflags_and_os_args()
$if windows { mut cflags := get_cmdline_cflags( fullargs )
return '-m32' $if !windows {
}$else{ cflags += ' -fPIC'
return '-fPIC -m32' }
} if '-m32' in fullargs {
}else{ cflags += ' -m32'
$if windows { }
return '' return cflags
}$else{ }
return '-fPIC'
fn get_cmdline_cflags(args []string) string {
mut cflags := ''
for ci, cv in args {
if cv == '-cflags' {
cflags += args[ci+1] + ' '
} }
} }
return cflags
} }

View File

@ -849,12 +849,7 @@ fn new_v(args[]string) &V {
files << f files << f
} }
mut cflags := '' cflags := get_cmdline_cflags(args)
for ci, cv in args {
if cv == '-cflags' {
cflags += args[ci+1] + ' '
}
}
rdir := os.realpath( dir ) rdir := os.realpath( dir )
rdir_name := os.filename( rdir ) rdir_name := os.filename( rdir )