summaryrefslogtreecommitdiffstats
path: root/methods.py
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2018-10-03 13:38:09 +0200
committerRémi Verschelde <rverschelde@gmail.com>2018-10-04 10:11:07 +0200
commit202466630562294db524859a158d46bc2a6ddcfb (patch)
treead73584d6fe58e517ecd67906a91c953b4c6e35d /methods.py
parent0e2de7481da3c74acc1a3120230e1bca2401919e (diff)
downloadredot-engine-202466630562294db524859a158d46bc2a6ddcfb.tar.gz
SCons: Add 'werror' opt-in to treat warning as errors
Also reorder advanced options to a more natural order, and fix MSVC warning when disabling warnings in secondary environment.
Diffstat (limited to 'methods.py')
-rw-r--r--methods.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/methods.py b/methods.py
index 3add9b1f18..0cf05751a8 100644
--- a/methods.py
+++ b/methods.py
@@ -22,6 +22,10 @@ def add_source_files(self, sources, filetype, lib_env=None, shared=False):
def disable_warnings(self):
# 'self' is the environment
if self.msvc:
+ # We have to remove existing warning level defines before appending /w,
+ # otherwise we get: "warning D9025 : overriding '/W3' with '/w'"
+ warn_flags = ['/Wall', '/W4', '/W3', '/W2', '/W1', '/WX']
+ self['CCFLAGS'] = [x for x in self['CCFLAGS'] if not x in warn_flags]
self.Append(CCFLAGS=['/w'])
else:
self.Append(CCFLAGS=['-w'])