summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Schlueter <jschlueter@navigationsolutions.com>2015-01-26 08:46:27 -0500
committerJon Schlueter <jschlueter@navigationsolutions.com>2015-01-26 08:49:14 -0500
commitce9d79d63bcc2d439ac22449910e0d91997c4e47 (patch)
treecea332e4af4681809475f52aaa99c83566815e95
parente8aec4fa3752dcf982fba1b7cdf4b1e1db53e588 (diff)
downloadgpsd-ce9d79d63bcc2d439ac22449910e0d91997c4e47.tar.gz
build system cleanup of duplicate CFLAGS entries
Add guards when adding in warnings to check for so that we don't add duplicate entries to CFLAGS This also deals with the warning generated with scons qt=on about -Wmissing-prototypes not a valid C++ option The error is that qt_env is stripping one copy of -Wmissing-prototype and -Wstrict-prototyes from CFLAGS so that it can compile with CXX
-rw-r--r--SConstruct6
1 files changed, 4 insertions, 2 deletions
diff --git a/SConstruct b/SConstruct
index 4eba37b3..f379e624 100644
--- a/SConstruct
+++ b/SConstruct
@@ -323,7 +323,8 @@ if 'MORECFLAGS' in os.environ:
# Don't change CFLAGS if already set by environment.
if not 'CFLAGS' in os.environ:
- env.Append(CFLAGS=['-Wmissing-prototypes'])
+ if '-Wmissing-prototypes' not in env['CFLAGS']:
+ env.Append(CFLAGS=['-Wmissing-prototypes'])
# Don't change CCFLAGS if already set by environment.
if not 'CCFLAGS' in os.environ:
@@ -503,7 +504,8 @@ else:
for option in ('-Wextra','-Wall', '-Wno-uninitialized','-Wno-missing-field-initializers',
'-Wcast-align','-Wmissing-declarations', '-Wmissing-prototypes',
'-Wstrict-prototypes', '-Wpointer-arith', '-Wreturn-type'):
- config.CheckCompilerOption(option)
+ if option not in config.env['CFLAGS']:
+ config.CheckCompilerOption(option)
if config.CheckCompilerOption("-pthread"):
env.MergeFlags("-pthread")