compilers: make sanity_check_impl a protected method

It's an implementation detail after all
pull/7786/head
Dylan Baker 4 years ago
parent 98416e7f75
commit 1592b7a800
  1. 2
      mesonbuild/compilers/c.py
  2. 2
      mesonbuild/compilers/cpp.py
  3. 4
      mesonbuild/compilers/mixins/clike.py

@ -64,7 +64,7 @@ class CCompiler(CLikeCompiler, Compiler):
def sanity_check(self, work_dir, environment): def sanity_check(self, work_dir, environment):
code = 'int main(void) { int class=0; return class; }\n' code = 'int main(void) { int class=0; return class; }\n'
return self.sanity_check_impl(work_dir, environment, 'sanitycheckc.c', code) return self._sanity_check_impl(work_dir, environment, 'sanitycheckc.c', code)
def has_header_symbol(self, hname, symbol, prefix, env, *, extra_args=None, dependencies=None): def has_header_symbol(self, hname, symbol, prefix, env, *, extra_args=None, dependencies=None):
fargs = {'prefix': prefix, 'header': hname, 'symbol': symbol} fargs = {'prefix': prefix, 'header': hname, 'symbol': symbol}

@ -77,7 +77,7 @@ class CPPCompiler(CLikeCompiler, Compiler):
def sanity_check(self, work_dir, environment): def sanity_check(self, work_dir, environment):
code = 'class breakCCompiler;int main(void) { return 0; }\n' code = 'class breakCCompiler;int main(void) { return 0; }\n'
return self.sanity_check_impl(work_dir, environment, 'sanitycheckcpp.cc', code) return self._sanity_check_impl(work_dir, environment, 'sanitycheckcpp.cc', code)
def get_compiler_check_args(self): def get_compiler_check_args(self):
# -fpermissive allows non-conforming code to compile which is necessary # -fpermissive allows non-conforming code to compile which is necessary

@ -325,7 +325,7 @@ class CLikeCompiler:
def gen_import_library_args(self, implibname: str) -> T.List[str]: def gen_import_library_args(self, implibname: str) -> T.List[str]:
return self.linker.import_library_args(implibname) return self.linker.import_library_args(implibname)
def sanity_check_impl(self, work_dir: str, environment: 'Environment', def _sanity_check_impl(self, work_dir: str, environment: 'Environment',
sname: str, code: str) -> None: sname: str, code: str) -> None:
mlog.debug('Sanity testing ' + self.get_display_language() + ' compiler:', ' '.join(self.exelist)) mlog.debug('Sanity testing ' + self.get_display_language() + ' compiler:', ' '.join(self.exelist))
mlog.debug('Is cross compiler: %s.' % str(self.is_cross)) mlog.debug('Is cross compiler: %s.' % str(self.is_cross))
@ -383,7 +383,7 @@ class CLikeCompiler:
def sanity_check(self, work_dir: str, environment: 'Environment') -> None: def sanity_check(self, work_dir: str, environment: 'Environment') -> None:
code = 'int main(void) { int class=0; return class; }\n' code = 'int main(void) { int class=0; return class; }\n'
return self.sanity_check_impl(work_dir, environment, 'sanitycheckc.c', code) return self._sanity_check_impl(work_dir, environment, 'sanitycheckc.c', code)
def check_header(self, hname: str, prefix: str, env: 'Environment', *, def check_header(self, hname: str, prefix: str, env: 'Environment', *,
extra_args: T.Optional[T.List[str]] = None, extra_args: T.Optional[T.List[str]] = None,

Loading…
Cancel
Save