compilers: Fix accidental coredata mutations

pull/6868/head
Ole André Vadla Ravnås 5 years ago committed by Jussi Pakkanen
parent 8bdc5c2dd5
commit 7195c0ee9c
  1. 3
      mesonbuild/compilers/fortran.py
  2. 3
      mesonbuild/compilers/objc.py
  3. 3
      mesonbuild/compilers/objcpp.py
  4. 3
      mesonbuild/compilers/swift.py
  5. 6
      mesonbuild/compilers/vala.py

@ -68,7 +68,8 @@ class FortranCompiler(CLikeCompiler, Compiler):
source_name.write_text('print *, "Fortran compilation is working."; end')
extra_flags = environment.coredata.get_external_args(self.for_machine, self.language)
extra_flags = []
extra_flags += environment.coredata.get_external_args(self.for_machine, self.language)
extra_flags += environment.coredata.get_external_link_args(self.for_machine, self.language)
extra_flags += self.get_always_args()
# %% build the test executable "sanitycheckf"

@ -44,7 +44,8 @@ class ObjCCompiler(CLikeCompiler, Compiler):
# TODO try to use sanity_check_impl instead of duplicated code
source_name = os.path.join(work_dir, 'sanitycheckobjc.m')
binary_name = os.path.join(work_dir, 'sanitycheckobjc')
extra_flags = environment.coredata.get_external_args(self.for_machine, self.language)
extra_flags = []
extra_flags += environment.coredata.get_external_args(self.for_machine, self.language)
if self.is_cross:
extra_flags += self.get_compile_only_args()
else:

@ -43,7 +43,8 @@ class ObjCPPCompiler(CLikeCompiler, Compiler):
# TODO try to use sanity_check_impl instead of duplicated code
source_name = os.path.join(work_dir, 'sanitycheckobjcpp.mm')
binary_name = os.path.join(work_dir, 'sanitycheckobjcpp')
extra_flags = environment.coredata.get_external_args(self.for_machine, self.language)
extra_flags = []
extra_flags += environment.coredata.get_external_args(self.for_machine, self.language)
if self.is_cross:
extra_flags += self.get_compile_only_args()
else:

@ -98,7 +98,8 @@ class SwiftCompiler(Compiler):
src = 'swifttest.swift'
source_name = os.path.join(work_dir, src)
output_name = os.path.join(work_dir, 'swifttest')
extra_flags = environment.coredata.get_external_args(self.for_machine, self.language)
extra_flags = []
extra_flags += environment.coredata.get_external_args(self.for_machine, self.language)
if self.is_cross:
extra_flags += self.get_compile_only_args()
else:

@ -94,7 +94,8 @@ class ValaCompiler(Compiler):
def sanity_check(self, work_dir, environment):
code = 'class MesonSanityCheck : Object { }'
extra_flags = environment.coredata.get_external_args(self.for_machine, self.language)
extra_flags = []
extra_flags += environment.coredata.get_external_args(self.for_machine, self.language)
if self.is_cross:
extra_flags += self.get_compile_only_args()
else:
@ -117,7 +118,8 @@ class ValaCompiler(Compiler):
# no extra dirs are specified.
if not extra_dirs:
code = 'class MesonFindLibrary : Object { }'
args = env.coredata.get_external_args(self.for_machine, self.language)
args = []
args += env.coredata.get_external_args(self.for_machine, self.language)
vapi_args = ['--pkg', libname]
args += vapi_args
with self.cached_compile(code, env.coredata, extra_args=args, mode='compile') as p:

Loading…
Cancel
Save