Moved targets with same name into subdirs to make all tests pass.
This commit is contained in:
parent
36870ace0f
commit
a9da6c5132
|
@ -1433,19 +1433,6 @@ rule FORTRAN_DEP_HACK
|
||||||
return []
|
return []
|
||||||
return compiler.get_no_stdinc_args()
|
return compiler.get_no_stdinc_args()
|
||||||
|
|
||||||
|
|
||||||
def get_pdb_name_suffix(self, target):
|
|
||||||
if isinstance(target, build.Executable):
|
|
||||||
suffix = '__exe'
|
|
||||||
elif isinstance(target, build.SharedLibrary):
|
|
||||||
suffix = '__dll'
|
|
||||||
elif isinstance(target, build.StaticLibrary):
|
|
||||||
suffix = '__lib'
|
|
||||||
else:
|
|
||||||
raise MesonException('Tried to build PDB for a non-buildtarget. Please file a bug.')
|
|
||||||
return suffix
|
|
||||||
|
|
||||||
|
|
||||||
def get_compile_debugfile_args(self, compiler, target, objfile):
|
def get_compile_debugfile_args(self, compiler, target, objfile):
|
||||||
if compiler.id != 'msvc':
|
if compiler.id != 'msvc':
|
||||||
return []
|
return []
|
||||||
|
@ -1473,16 +1460,14 @@ rule FORTRAN_DEP_HACK
|
||||||
#
|
#
|
||||||
# If you feel that the above is completely wrong and all of this is
|
# If you feel that the above is completely wrong and all of this is
|
||||||
# actually doable, please send patches.
|
# actually doable, please send patches.
|
||||||
suffix = self.get_pdb_name_suffix(target)
|
|
||||||
if target.has_pch():
|
if target.has_pch():
|
||||||
tfilename = self.get_target_filename_abs(target)
|
tfilename = self.get_target_filename_abs(target)
|
||||||
return compiler.get_compile_debugfile_args(tfilename, suffix)
|
return compiler.get_compile_debugfile_args(tfilename)
|
||||||
else:
|
else:
|
||||||
return compiler.get_compile_debugfile_args(objfile, suffix)
|
return compiler.get_compile_debugfile_args(objfile)
|
||||||
|
|
||||||
def get_link_debugfile_args(self, linker, target, outname):
|
def get_link_debugfile_args(self, linker, target, outname):
|
||||||
suffix = self.get_pdb_name_suffix(target)
|
return linker.get_link_debugfile_args(outname)
|
||||||
return linker.get_link_debugfile_args(outname, suffix)
|
|
||||||
|
|
||||||
def generate_single_compile(self, target, outfile, src, is_generated=False, header_deps=[], order_deps=[]):
|
def generate_single_compile(self, target, outfile, src, is_generated=False, header_deps=[], order_deps=[]):
|
||||||
if(isinstance(src, str) and src.endswith('.h')):
|
if(isinstance(src, str) and src.endswith('.h')):
|
||||||
|
|
|
@ -354,10 +354,10 @@ class Compiler():
|
||||||
|
|
||||||
# Some compilers (msvc) write debug info to a separate file.
|
# Some compilers (msvc) write debug info to a separate file.
|
||||||
# These args specify where it should be written.
|
# These args specify where it should be written.
|
||||||
def get_compile_debugfile_args(self, rel_obj, fname_suffix):
|
def get_compile_debugfile_args(self, rel_obj):
|
||||||
return []
|
return []
|
||||||
|
|
||||||
def get_link_debugfile_args(self, rel_obj, fname_suffix):
|
def get_link_debugfile_args(self, rel_obj):
|
||||||
return []
|
return []
|
||||||
|
|
||||||
class CCompiler(Compiler):
|
class CCompiler(Compiler):
|
||||||
|
@ -1607,15 +1607,13 @@ class VisualStudioCCompiler(CCompiler):
|
||||||
raise MesonException('Compiling test app failed.')
|
raise MesonException('Compiling test app failed.')
|
||||||
return not(warning_text in stde or warning_text in stdo)
|
return not(warning_text in stde or warning_text in stdo)
|
||||||
|
|
||||||
def get_compile_debugfile_args(self, rel_obj, name_suffix):
|
def get_compile_debugfile_args(self, rel_obj):
|
||||||
pdbarr = rel_obj.split('.')[:-1]
|
pdbarr = rel_obj.split('.')[:-1]
|
||||||
pdbarr[-1] += name_suffix
|
|
||||||
pdbarr += ['pdb']
|
pdbarr += ['pdb']
|
||||||
return ['/Fd' + '.'.join(pdbarr)]
|
return ['/Fd' + '.'.join(pdbarr)]
|
||||||
|
|
||||||
def get_link_debugfile_args(self, targetfile, name_suffix):
|
def get_link_debugfile_args(self, targetfile):
|
||||||
pdbarr = targetfile.split('.')[:-1]
|
pdbarr = targetfile.split('.')[:-1]
|
||||||
pdbarr[-1] += name_suffix
|
|
||||||
pdbarr += ['pdb']
|
pdbarr += ['pdb']
|
||||||
return ['/DEBUG', '/PDB:' + '.'.join(pdbarr)]
|
return ['/DEBUG', '/PDB:' + '.'.join(pdbarr)]
|
||||||
|
|
||||||
|
@ -2295,9 +2293,8 @@ class VisualStudioLinker():
|
||||||
def unix_compile_flags_to_native(self, args):
|
def unix_compile_flags_to_native(self, args):
|
||||||
return args[:]
|
return args[:]
|
||||||
|
|
||||||
def get_link_debugfile_args(self, targetfile, name_suffix):
|
def get_link_debugfile_args(self, targetfile):
|
||||||
pdbarr = targetfile.split('.')[:-1]
|
pdbarr = targetfile.split('.')[:-1]
|
||||||
pdbarr[-1] += name_suffix
|
|
||||||
pdbarr += ['pdb']
|
pdbarr += ['pdb']
|
||||||
return ['/DEBUG', '/PDB:' + '.'.join(pdbarr)]
|
return ['/DEBUG', '/PDB:' + '.'.join(pdbarr)]
|
||||||
|
|
||||||
|
@ -2350,5 +2347,5 @@ class ArLinker():
|
||||||
def unix_compile_flags_to_native(self, args):
|
def unix_compile_flags_to_native(self, args):
|
||||||
return args[:]
|
return args[:]
|
||||||
|
|
||||||
def get_link_debugfile_args(self, targetfile, suffix):
|
def get_link_debugfile_args(self, targetfile):
|
||||||
return []
|
return []
|
||||||
|
|
|
@ -1,13 +1,11 @@
|
||||||
project('same basename', 'c')
|
project('same basename', 'c')
|
||||||
|
|
||||||
|
subdir('sharedsub')
|
||||||
|
subdir('staticsub')
|
||||||
|
|
||||||
# Use the same source file to check that each top level target
|
# Use the same source file to check that each top level target
|
||||||
# has its own unique working directory. If they don't
|
# has its own unique working directory. If they don't
|
||||||
# then the .o files will clobber each other.
|
# then the .o files will clobber each other.
|
||||||
shlib = shared_library('name', 'lib.c', c_args : '-DSHAR')
|
|
||||||
|
|
||||||
# On Windows a static lib is now libfoo.a, so it does not conflict with foo.lib
|
|
||||||
# from the shared library above
|
|
||||||
stlib = static_library('name', 'lib.c', c_args : '-DSTAT')
|
|
||||||
|
|
||||||
exe1 = executable('name', 'exe1.c', link_with : stlib)
|
exe1 = executable('name', 'exe1.c', link_with : stlib)
|
||||||
exe2 = executable('name2', 'exe2.c', link_with : shlib)
|
exe2 = executable('name2', 'exe2.c', link_with : shlib)
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
shlib = shared_library('name', '../lib.c', c_args : '-DSHAR')
|
|
@ -0,0 +1,3 @@
|
||||||
|
# On Windows a static lib is now libfoo.a, so it does not conflict with foo.lib
|
||||||
|
# from the shared library above
|
||||||
|
stlib = static_library('name', '../lib.c', c_args : '-DSTAT')
|
Loading…
Reference in New Issue