Added more compiler option support

pull/4547/head
Daniel Mensinger 6 years ago
parent bd8bad46c3
commit 9eca2e46a0
No known key found for this signature in database
GPG Key ID: 54DD94C131E277D4
  1. 6
      mesonbuild/compilers/cs.py
  2. 8
      mesonbuild/compilers/d.py
  3. 2
      mesonbuild/compilers/fortran.py
  4. 6
      mesonbuild/compilers/java.py
  5. 8
      mesonbuild/compilers/rust.py
  6. 2
      mesonbuild/compilers/swift.py
  7. 10
      mesonbuild/compilers/vala.py

@ -89,6 +89,12 @@ class CsCompiler(Compiler):
return [] return []
def compute_parameters_with_absolute_paths(self, parameter_list, build_dir): def compute_parameters_with_absolute_paths(self, parameter_list, build_dir):
for idx, i in enumerate(parameter_list):
if i[:2] == '-L':
parameter_list[idx] = i[:2] + os.path.normpath(os.path.join(build_dir, i[2:]))
if i[:5] == '-lib:':
parameter_list[idx] = i[:5] + os.path.normpath(os.path.join(build_dir, i[5:]))
return parameter_list return parameter_list
def name_string(self): def name_string(self):

@ -115,6 +115,12 @@ class DCompiler(Compiler):
for idx, i in enumerate(parameter_list): for idx, i in enumerate(parameter_list):
if i[:3] == '-I=': if i[:3] == '-I=':
parameter_list[idx] = i[:3] + os.path.normpath(os.path.join(build_dir, i[3:])) parameter_list[idx] = i[:3] + os.path.normpath(os.path.join(build_dir, i[3:]))
if i[:4] == '-L-L':
parameter_list[idx] = i[:4] + os.path.normpath(os.path.join(build_dir, i[4:]))
if i[:5] == '-L=-L':
parameter_list[idx] = i[:5] + os.path.normpath(os.path.join(build_dir, i[5:]))
if i[:6] == '-Wl,-L':
parameter_list[idx] = i[:6] + os.path.normpath(os.path.join(build_dir, i[6:]))
return parameter_list return parameter_list
@ -520,7 +526,7 @@ class GnuDCompiler(DCompiler):
def compute_parameters_with_absolute_paths(self, parameter_list, build_dir): def compute_parameters_with_absolute_paths(self, parameter_list, build_dir):
for idx, i in enumerate(parameter_list): for idx, i in enumerate(parameter_list):
if i[:2] == '-I': if i[:2] == '-I' or i[:2] == '-L':
parameter_list[idx] = i[:2] + os.path.normpath(os.path.join(build_dir, i[2:])) parameter_list[idx] = i[:2] + os.path.normpath(os.path.join(build_dir, i[2:]))
return parameter_list return parameter_list

@ -173,7 +173,7 @@ end program prog
def compute_parameters_with_absolute_paths(self, parameter_list, build_dir): def compute_parameters_with_absolute_paths(self, parameter_list, build_dir):
for idx, i in enumerate(parameter_list): for idx, i in enumerate(parameter_list):
if i[:2] == '-I': if i[:2] == '-I' or i[:2] == '-L':
parameter_list[idx] = i[:2] + os.path.normpath(os.path.join(build_dir, i[2:])) parameter_list[idx] = i[:2] + os.path.normpath(os.path.join(build_dir, i[2:]))
return parameter_list return parameter_list

@ -82,6 +82,12 @@ class JavaCompiler(Compiler):
return java_buildtype_args[buildtype] return java_buildtype_args[buildtype]
def compute_parameters_with_absolute_paths(self, parameter_list, build_dir): def compute_parameters_with_absolute_paths(self, parameter_list, build_dir):
for idx, i in enumerate(parameter_list):
if i[:4] == '-cp:' or i[:4] == '-cp;':
parameter_list[idx] = i[:4] + os.path.normpath(os.path.join(build_dir, i[4:]))
if i[:11] == '-classpath:' or i[:11] == '-classpath;':
parameter_list[idx] = i[:11] + os.path.normpath(os.path.join(build_dir, i[11:]))
return parameter_list return parameter_list
def sanity_check(self, work_dir, environment): def sanity_check(self, work_dir, environment):

@ -84,4 +84,12 @@ class RustCompiler(Compiler):
return rust_optimization_args[optimization_level] return rust_optimization_args[optimization_level]
def compute_parameters_with_absolute_paths(self, parameter_list, build_dir): def compute_parameters_with_absolute_paths(self, parameter_list, build_dir):
for idx, i in enumerate(parameter_list):
if i[:2] == '-L':
for j in ['dependency', 'crate', 'native', 'framework', 'all']:
combined_len = len(j) + 3
if i[:combined_len] == '-L{}='.format(j):
parameter_list[idx] = i[:combined_len] + os.path.normpath(os.path.join(build_dir, i[combined_len:]))
break
return parameter_list return parameter_list

@ -93,7 +93,7 @@ class SwiftCompiler(Compiler):
def compute_parameters_with_absolute_paths(self, parameter_list, build_dir): def compute_parameters_with_absolute_paths(self, parameter_list, build_dir):
for idx, i in enumerate(parameter_list): for idx, i in enumerate(parameter_list):
if i[:2] == '-I': if i[:2] == '-I' or i[:2] == '-L':
parameter_list[idx] = i[:2] + os.path.normpath(os.path.join(build_dir, i[2:])) parameter_list[idx] = i[:2] + os.path.normpath(os.path.join(build_dir, i[2:]))
return parameter_list return parameter_list

@ -67,6 +67,16 @@ class ValaCompiler(Compiler):
return [] return []
def compute_parameters_with_absolute_paths(self, parameter_list, build_dir): def compute_parameters_with_absolute_paths(self, parameter_list, build_dir):
for idx, i in enumerate(parameter_list):
if i[:9] == '--girdir=':
parameter_list[idx] = i[:9] + os.path.normpath(os.path.join(build_dir, i[9:]))
if i[:10] == '--vapidir=':
parameter_list[idx] = i[:10] + os.path.normpath(os.path.join(build_dir, i[10:]))
if i[:13] == '--includedir=':
parameter_list[idx] = i[:13] + os.path.normpath(os.path.join(build_dir, i[13:]))
if i[:14] == '--metadatadir=':
parameter_list[idx] = i[:14] + os.path.normpath(os.path.join(build_dir, i[14:]))
return parameter_list return parameter_list
def sanity_check(self, work_dir, environment): def sanity_check(self, work_dir, environment):

Loading…
Cancel
Save