Disable cache for dependencies

pull/4952/head
Daniel Mensinger 6 years ago
parent 47c06a7875
commit 8a32fc8dbe
No known key found for this signature in database
GPG Key ID: 54DD94C131E277D4
  1. 8
      mesonbuild/compilers/c.py
  2. 8
      mesonbuild/compilers/fortran.py
  3. 2
      mesonbuild/dependencies/boost.py
  4. 4
      mesonbuild/dependencies/misc.py
  5. 2
      mesonbuild/dependencies/ui.py

@ -368,7 +368,7 @@ class CCompiler(Compiler):
return self.compiles(code.format(**fargs), env, extra_args=extra_args,
dependencies=dependencies)
def has_header(self, hname, prefix, env, *, extra_args=None, dependencies=None):
def has_header(self, hname, prefix, env, *, extra_args=None, dependencies=None, disable_cache=False):
fargs = {'prefix': prefix, 'header': hname}
code = '''{prefix}
#ifdef __has_include
@ -379,7 +379,7 @@ class CCompiler(Compiler):
#include <{header}>
#endif'''
return self.compiles(code.format(**fargs), env, extra_args=extra_args,
dependencies=dependencies, mode='preprocess')
dependencies=dependencies, mode='preprocess', disable_cache=disable_cache)
def has_header_symbol(self, hname, symbol, prefix, env, *, extra_args=None, dependencies=None):
fargs = {'prefix': prefix, 'header': hname, 'symbol': symbol}
@ -641,7 +641,7 @@ class CCompiler(Compiler):
raise EnvironmentException('Could not determine alignment of %s. Sorry. You might want to file a bug.' % typename)
return align
def get_define(self, dname, prefix, env, extra_args, dependencies):
def get_define(self, dname, prefix, env, extra_args, dependencies, disable_cache=False):
delim = '"MESON_GET_DEFINE_DELIMITER"'
fargs = {'prefix': prefix, 'define': dname, 'delim': delim}
code = '''
@ -652,7 +652,7 @@ class CCompiler(Compiler):
{delim}\n{define}'''
args = self._get_compiler_check_args(env, extra_args, dependencies,
mode='preprocess').to_native()
with self.compile(code.format(**fargs), args, 'preprocess', cdata=env.coredata) as p:
with self.compile(code.format(**fargs), args, 'preprocess', cdata=env.coredata if not disable_cache else None) as p:
cached = p.cached
if p.returncode != 0:
raise EnvironmentException('Could not get define {!r}'.format(dname))

@ -297,11 +297,11 @@ class FortranCompiler(Compiler):
def has_multi_arguments(self, args, env):
return CCompiler.has_multi_arguments(self, args, env)
def has_header(self, hname, prefix, env, *, extra_args=None, dependencies=None):
return CCompiler.has_header(self, hname, prefix, env, extra_args=extra_args, dependencies=dependencies)
def has_header(self, hname, prefix, env, *, extra_args=None, dependencies=None, disable_cache=False):
return CCompiler.has_header(self, hname, prefix, env, extra_args=extra_args, dependencies=dependencies, disable_cache=disable_cache)
def get_define(self, dname, prefix, env, extra_args, dependencies):
return CCompiler.get_define(self, dname, prefix, env, extra_args, dependencies)
def get_define(self, dname, prefix, env, extra_args, dependencies, disable_cache=False):
return CCompiler.get_define(self, dname, prefix, env, extra_args, dependencies, disable_cache=disable_cache)
@classmethod
def _get_trials_from_pattern(cls, pattern, directory, libname):

@ -250,7 +250,7 @@ class BoostDependency(ExternalDependency):
def detect_headers_and_version(self):
try:
version = self.clib_compiler.get_define('BOOST_LIB_VERSION', '#include <boost/version.hpp>', self.env, self.get_compile_args(), [])[0]
version = self.clib_compiler.get_define('BOOST_LIB_VERSION', '#include <boost/version.hpp>', self.env, self.get_compile_args(), [], disable_cache=True)[0]
except mesonlib.EnvironmentException:
return
except TypeError:

@ -368,7 +368,7 @@ class OpenMPDependency(ExternalDependency):
self.is_found = False
try:
openmp_date = self.clib_compiler.get_define(
'_OPENMP', '', self.env, self.clib_compiler.openmp_flags(), [self])[0]
'_OPENMP', '', self.env, self.clib_compiler.openmp_flags(), [self], disable_cache=True)[0]
except mesonlib.EnvironmentException as e:
mlog.debug('OpenMP support not available in the compiler')
mlog.debug(e)
@ -376,7 +376,7 @@ class OpenMPDependency(ExternalDependency):
if openmp_date:
self.version = self.VERSIONS[openmp_date]
if self.clib_compiler.has_header('omp.h', '', self.env, dependencies=[self])[0]:
if self.clib_compiler.has_header('omp.h', '', self.env, dependencies=[self], disable_cache=True)[0]:
self.is_found = True
self.compile_args = self.link_args = self.clib_compiler.openmp_flags()
else:

@ -641,7 +641,7 @@ class VulkanDependency(ExternalDependency):
else:
# simply try to guess it, usually works on linux
libs = self.clib_compiler.find_library('vulkan', environment, [])
if libs is not None and self.clib_compiler.has_header('vulkan/vulkan.h', '', environment)[0]:
if libs is not None and self.clib_compiler.has_header('vulkan/vulkan.h', '', environment, disable_cache=True)[0]:
self.type_name = 'system'
self.is_found = True
for lib in libs:

Loading…
Cancel
Save