wscript: *prepend* CFLAGS and LINKFLAGS

Appending new options at end of the array has unfortunate effect
of not allowing easy override of flags set in wscript.

This change makes add_cflag() and add_linkflag() prepend,
thus leaving the supplied during configure parameters
take precedence by being at the end of the parameter list.

Fix for [a386c3e] LDFLAGS is ignored
This commit is contained in:
Nedko Arnaudov 2023-05-05 16:52:11 +03:00
parent 3da9b8d6e7
commit 88b70fcdd7
1 changed files with 3 additions and 3 deletions

View File

@ -63,11 +63,11 @@ def options(opt):
opt.load('parallel_debug')
def add_cflag(conf, flag):
conf.env.append_unique('CXXFLAGS', flag)
conf.env.append_unique('CFLAGS', flag)
conf.env.prepend_unique('CXXFLAGS', flag)
conf.env.prepend_unique('CFLAGS', flag)
def add_linkflag(conf, flag):
conf.env.append_unique('LINKFLAGS', flag)
conf.env.prepend_unique('LINKFLAGS', flag)
def check_gcc_optimizations_enabled(flags):
gcc_optimizations_enabled = False