aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2016-08-11 16:25:58 +0530
committerNirbheek Chauhan <nirbheek@centricular.com>2016-08-12 15:34:18 +0530
commit5b7e4ac1f69c88c6bf1d46e92a41e60ea666c753 (patch)
treecd8650e889d1a9562f31cac1f2175e3eca416821
parent01b43e5f0ada65370e19e2dbeac0773f4177ac73 (diff)
downloadmeson-5b7e4ac1f69c88c6bf1d46e92a41e60ea666c753.zip
meson-5b7e4ac1f69c88c6bf1d46e92a41e60ea666c753.tar.gz
meson-5b7e4ac1f69c88c6bf1d46e92a41e60ea666c753.tar.bz2
compilers: Always return a copy of the exelist
The consumer might append to it, which will mess up the original object
-rw-r--r--mesonbuild/compilers.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/mesonbuild/compilers.py b/mesonbuild/compilers.py
index 30eecec..d020033 100644
--- a/mesonbuild/compilers.py
+++ b/mesonbuild/compilers.py
@@ -1255,7 +1255,7 @@ class ValaCompiler(Compiler):
return False # Because compiles into C.
def get_exelist(self):
- return self.exelist
+ return self.exelist[:]
def get_werror_args(self):
return ['--fatal-warnings']
@@ -1299,7 +1299,7 @@ class RustCompiler(Compiler):
return ' '.join(self.exelist)
def get_exelist(self):
- return self.exelist
+ return self.exelist[:]
def get_id(self):
return self.id
@@ -1343,7 +1343,7 @@ class SwiftCompiler(Compiler):
return self.id
def get_linker_exelist(self):
- return self.exelist
+ return self.exelist[:]
def name_string(self):
return ' '.join(self.exelist)
@@ -1352,7 +1352,7 @@ class SwiftCompiler(Compiler):
return True
def get_exelist(self):
- return self.exelist
+ return self.exelist[:]
def get_werror_args(self):
return ['--fatal-warnings']
@@ -1973,7 +1973,7 @@ class FortranCompiler(Compiler):
return ' '.join(self.exelist)
def get_exelist(self):
- return self.exelist
+ return self.exelist[:]
def get_language(self):
return self.language
@@ -2240,7 +2240,7 @@ class VisualStudioLinker():
self.exelist = exelist
def get_exelist(self):
- return self.exelist
+ return self.exelist[:]
def get_std_link_args(self):
return []
@@ -2292,7 +2292,7 @@ class ArLinker():
return []
def get_exelist(self):
- return self.exelist
+ return self.exelist[:]
def get_std_link_args(self):
return self.std_args