From 88b70fcdd71bae67f0281d5752086a652a435bcd Mon Sep 17 00:00:00 2001 From: Nedko Arnaudov Date: Fri, 5 May 2023 16:52:11 +0300 Subject: [PATCH] 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 --- wscript | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/wscript b/wscript index 404cc9ea..0ae35367 100644 --- a/wscript +++ b/wscript @@ -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