Skip to content

Commit

Permalink
Force clang to error out on unknown arguments. Closes #755.
Browse files Browse the repository at this point in the history
  • Loading branch information
jpakkane committed Sep 4, 2016
1 parent ba04567 commit b289547
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 6 additions & 0 deletions mesonbuild/compilers.py
Original file line number Diff line number Diff line change
Expand Up @@ -2126,6 +2126,9 @@ def get_option_compile_args(self, options):
def get_option_link_args(self, options):
return []

def has_argument(self, arg, env):
return super().has_argument(['-Werror=unknown-warning-option', arg], env)

class GnuCPPCompiler(CPPCompiler):
# may need to separate the latter to extra_debug_args or something
std_debug_args = ['-g']
Expand Down Expand Up @@ -2240,6 +2243,9 @@ def get_option_compile_args(self, options):
def get_option_link_args(self, options):
return []

def has_argument(self, arg, env):
return super().has_argument(['-Werror=unknown-warning-option', arg], env)

class FortranCompiler(Compiler):
def __init__(self, exelist, version, is_cross, exe_wrapper=None):
super().__init__(exelist, version)
Expand Down
3 changes: 2 additions & 1 deletion test cases/common/103 manygen/subdir/manygen.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
shutil.which('clang') or \
shutil.which('cc')

if 'cl' in os.path.basename(compiler):
compbase = os.path.basename(compiler)
if 'cl' in compbase and 'clang' not in compbase:
libsuffix = '.lib'
is_vs = True
compiler = 'cl'
Expand Down

0 comments on commit b289547

Please sign in to comment.