Author: brane Date: Fri Jul 4 13:50:29 2025 New Revision: 1926953 URL: http://svn.apache.org/viewvc?rev=1926953&view=rev Log: SCons flags are sometimes tuples, not strings. For example, -isystem /usr/includ/krb5 gets converted to a tuple. This breaks CCFLAGS filtering in some cases.
* SConstruct: Use the first member of a non-string flag as the flag name. Modified: serf/trunk/SConstruct Modified: serf/trunk/SConstruct URL: http://svn.apache.org/viewvc/serf/trunk/SConstruct?rev=1926953&r1=1926952&r2=1926953&view=diff ============================================================================== --- serf/trunk/SConstruct (original) +++ serf/trunk/SConstruct Fri Jul 4 13:50:29 2025 @@ -749,10 +749,15 @@ mockenv.Replace(CFLAGS = [f.replace('-st for f in mockenv['CFLAGS']]) mockenv.Replace(CCFLAGS = list( filter(lambda f: (SHOW_MOCKHTTP_WARNINGS + # NOTE: SCons flags are sometimes tuples, not strings. + # In those cases, the first element is the flag + # and the rest ar the flag's value(s). or (# GCC-like warning flags - not re.match(r'^\s*-W[a-z][a-z-]+', f) + not re.match(r'^\s*-W[a-z][a-z-]+', + f if type(f) == type('') else f[0]) # MSVC-like warning flags - and not re.match(r'^\s*/(W|w[de])\d+', f))), + and not re.match(r'^\s*/(W|w[de])\d+', + f if type(f) == type('') else f[0]))), mockenv['CCFLAGS']) )) if not SHOW_MOCKHTTP_WARNINGS: