cgen/builder: make unused-command-line-argument a warning & cgen module_built fix
parent
fc251a653e
commit
dd27d0a2a3
|
@ -194,7 +194,7 @@ fn (mut v Builder) setup_ccompiler_options(ccompiler string) {
|
||||||
'-Wcast-qual', '-Wdate-time', '-Wduplicated-branches', '-Wduplicated-cond', '-Wformat=2', '-Winit-self',
|
'-Wcast-qual', '-Wdate-time', '-Wduplicated-branches', '-Wduplicated-cond', '-Wformat=2', '-Winit-self',
|
||||||
'-Winvalid-pch', '-Wjump-misses-init', '-Wlogical-op', '-Wmultichar', '-Wnested-externs', '-Wnull-dereference',
|
'-Winvalid-pch', '-Wjump-misses-init', '-Wlogical-op', '-Wmultichar', '-Wnested-externs', '-Wnull-dereference',
|
||||||
'-Wpacked', '-Wpointer-arith', '-Wshadow', '-Wswitch-default', '-Wswitch-enum', '-Wno-unused-parameter',
|
'-Wpacked', '-Wpointer-arith', '-Wshadow', '-Wswitch-default', '-Wswitch-enum', '-Wno-unused-parameter',
|
||||||
'-Wno-unknown-warning-option', '-Wno-format-nonliteral']
|
'-Wno-unknown-warning-option', '-Wno-format-nonliteral', '-Wno-unused-command-line-argument']
|
||||||
if v.pref.os == .ios {
|
if v.pref.os == .ios {
|
||||||
ccoptions.args << '-framework Foundation'
|
ccoptions.args << '-framework Foundation'
|
||||||
ccoptions.args << '-framework UIKit'
|
ccoptions.args << '-framework UIKit'
|
||||||
|
|
|
@ -144,12 +144,12 @@ pub fn cgen(files []ast.File, table &table.Table, pref &pref.Preferences) string
|
||||||
if pref.build_mode == .build_module {
|
if pref.build_mode == .build_module {
|
||||||
// TODO: detect this properly for all cases
|
// TODO: detect this properly for all cases
|
||||||
// either get if from an earlier stage or use the lookup paths
|
// either get if from an earlier stage or use the lookup paths
|
||||||
if pref.path.contains('vlib' + os.path_separator) {
|
for dir_name in ['vlib', '.vmodules', 'modules'] {
|
||||||
module_built = pref.path.after('vlib' + os.path_separator).replace(os.path_separator,
|
if pref.path.contains(dir_name + os.path_separator) {
|
||||||
'.')
|
module_built = pref.path.after(dir_name + os.path_separator).replace(os.path_separator,
|
||||||
} else if pref.path.contains('.vmodules' + os.path_separator) {
|
'.')
|
||||||
module_built = pref.path.after('.vmodules' + os.path_separator).replace(os.path_separator,
|
break
|
||||||
'.')
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
mut timers_should_print := false
|
mut timers_should_print := false
|
||||||
|
|
Loading…
Reference in New Issue