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

compiler: pass -cflags to thirdparty building stage too

This commit is contained in:
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 {
if '-m32' in os.args{
$if windows {
return '-m32'
}$else{
return '-fPIC -m32'
}
}else{
$if windows {
return ''
}$else{
return '-fPIC'
fullargs := env_vflags_and_os_args()
mut cflags := get_cmdline_cflags( fullargs )
$if !windows {
cflags += ' -fPIC'
}
if '-m32' in fullargs {
cflags += ' -m32'
}
return cflags
}
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
}
mut cflags := ''
for ci, cv in args {
if cv == '-cflags' {
cflags += args[ci+1] + ' '
}
}
cflags := get_cmdline_cflags(args)
rdir := os.realpath( dir )
rdir_name := os.filename( rdir )