aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/compilers
diff options
context:
space:
mode:
authorDaniel Mensinger <daniel@mensinger-ka.de>2019-03-03 22:59:38 +0100
committerDaniel Mensinger <daniel@mensinger-ka.de>2019-04-28 14:33:21 +0200
commit210fe5bf40f596e50da9c39f15e101459deac9eb (patch)
tree8028bd6ed2aa65f0e7ca51b061cb1bb711e5d42d /mesonbuild/compilers
parent6969772a3e915e3a6cd577ec7b54bf2d2ed604c8 (diff)
downloadmeson-210fe5bf40f596e50da9c39f15e101459deac9eb.zip
meson-210fe5bf40f596e50da9c39f15e101459deac9eb.tar.gz
meson-210fe5bf40f596e50da9c39f15e101459deac9eb.tar.bz2
Add option to disable the cache
Diffstat (limited to 'mesonbuild/compilers')
-rw-r--r--mesonbuild/compilers/c.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/mesonbuild/compilers/c.py b/mesonbuild/compilers/c.py
index 7df31b6..2e796ae 100644
--- a/mesonbuild/compilers/c.py
+++ b/mesonbuild/compilers/c.py
@@ -444,17 +444,17 @@ class CCompiler(Compiler):
args += extra_args
return args
- def compiles(self, code, env, *, extra_args=None, dependencies=None, mode='compile'):
- with self._build_wrapper(code, env, extra_args, dependencies, mode) as p:
+ def compiles(self, code, env, *, extra_args=None, dependencies=None, mode='compile', disable_cache=False):
+ with self._build_wrapper(code, env, extra_args, dependencies, mode, disable_cache=disable_cache) as p:
return p.returncode == 0, p.cached
- def _build_wrapper(self, code, env, extra_args, dependencies=None, mode='compile', want_output=False):
+ def _build_wrapper(self, code, env, extra_args, dependencies=None, mode='compile', want_output=False, disable_cache=False):
args = self._get_compiler_check_args(env, extra_args, dependencies, mode)
- return self.compile(code, args, mode, want_output=want_output, cdata=env.coredata)
+ return self.compile(code, args, mode, want_output=want_output, cdata=env.coredata if not disable_cache else None)
- def links(self, code, env, *, extra_args=None, dependencies=None):
+ def links(self, code, env, *, extra_args=None, dependencies=None, disable_cache=False):
return self.compiles(code, env, extra_args=extra_args,
- dependencies=dependencies, mode='link')
+ dependencies=dependencies, mode='link', disable_cache=disable_cache)
def run(self, code: str, env, *, extra_args=None, dependencies=None):
if self.is_cross and self.exe_wrapper is None:
@@ -1022,7 +1022,7 @@ class CCompiler(Compiler):
libname in self.internal_libs):
args = ['-l' + libname]
largs = self.linker_to_compiler_args(self.get_allow_undefined_link_args())
- if self.links(code, env, extra_args=(args + largs))[0]:
+ if self.links(code, env, extra_args=(args + largs), disable_cache=True)[0]:
return args
# Don't do a manual search for internal libs
if libname in self.internal_libs:
@@ -1111,7 +1111,7 @@ class CCompiler(Compiler):
# then we must also pass -L/usr/lib to pick up libSystem.dylib
extra_args = [] if allow_system else ['-Z', '-L/usr/lib']
link_args += ['-framework', name]
- if self.links(code, env, extra_args=(extra_args + link_args))[0]:
+ if self.links(code, env, extra_args=(extra_args + link_args), disable_cache=True)[0]:
return link_args
def find_framework_impl(self, name, env, extra_dirs, allow_system):