From 6cca79b052b75bf174c2e482cc5d3e1a6cec4b02 Mon Sep 17 00:00:00 2001 From: Jussi Pakkanen Date: Thu, 27 Aug 2015 00:25:04 +0300 Subject: Added multiple selectable warning levels. --- compilers.py | 83 ++++++++++++++++++++++++++---------------------------------- 1 file changed, 36 insertions(+), 47 deletions(-) (limited to 'compilers.py') diff --git a/compilers.py b/compilers.py index 134edda22..fbaf43316 100644 --- a/compilers.py +++ b/compilers.py @@ -145,6 +145,9 @@ class CCompiler(): def get_linker_always_args(self): return [] + def get_warn_args(self, level): + return self.warn_args[level] + def get_soname_args(self, shlib_name, path, soversion): return [] @@ -913,13 +916,13 @@ class VisualStudioCCompiler(CCompiler): self.always_args = VisualStudioCCompiler.vs2013_always_args else: self.always_args = VisualStudioCCompiler.vs2010_always_args + self.std_warn_args = {'1': ['/W2'], + '2': ['/W3'], + '3': ['/w4']} def get_always_args(self): return self.always_args - def get_std_warn_args(self): - return self.std_warn_args - def get_buildtype_args(self, buildtype): return msvc_buildtype_args[buildtype] @@ -1045,24 +1048,17 @@ def get_gcc_soname_args(gcc_type, shlib_name, path, soversion): raise RuntimeError('Not implemented yet.') class GnuCCompiler(CCompiler): - old_warn = ['-Wall', '-pedantic', '-Winvalid-pch'] - new_warn = ['-Wall', '-Wpedantic', '-Winvalid-pch'] - def __init__(self, exelist, version, gcc_type, is_cross, exe_wrapper=None): CCompiler.__init__(self, exelist, version, is_cross, exe_wrapper) self.id = 'gcc' self.gcc_type = gcc_type - if mesonlib.version_compare(version, ">=4.9.0"): - self.warn_args= GnuCCompiler.new_warn - else: - self.warn_args = GnuCCompiler.old_warn + self.warn_args = {'1': ['-Wall', '-Winvalid-pch'], + '2': ['-Wall', '-Wpedantic', '-Winvalid-pch'], + '3' : ['-Wall', '-Wpedantic', '-Wextra', '-Winvalid-pch']} def get_always_args(self): return ['-pipe'] - def get_std_warn_args(self): - return self.warn_args - def get_buildtype_args(self, buildtype): return gnulike_buildtype_args[buildtype] @@ -1082,7 +1078,7 @@ class GnuCCompiler(CCompiler): return super().can_compile(filename) or filename.split('.')[-1].lower() == 's' # Gcc can do asm, too. class GnuObjCCompiler(ObjCCompiler): - std_warn_args = ['-Wall', '-Wpedantic', '-Winvalid-pch'] + std_opt_args = ['-O2'] def __init__(self, exelist, version, is_cross, exe_wrapper=None): ObjCCompiler.__init__(self, exelist, version, is_cross, exe_wrapper) @@ -1090,9 +1086,9 @@ class GnuObjCCompiler(ObjCCompiler): # Not really correct, but GNU objc is only used on non-OSX non-win. File a bug # if this breaks your use case. self.gcc_type = GCC_STANDARD - - def get_std_warn_args(self): - return GnuObjCCompiler.std_warn_args + self.warn_args = {'1': ['-Wall', '-Winvalid-pch'], + '2': ['-Wall', '-Wpedantic', '-Winvalid-pch'], + '3' : ['-Wall', '-Wpedantic', '-Wextra', '-Winvalid-pch']} def get_buildtype_args(self, buildtype): return gnulike_buildtype_args[buildtype] @@ -1107,7 +1103,6 @@ class GnuObjCCompiler(ObjCCompiler): return get_gcc_soname_args(self.gcc_type, shlib_name, path, soversion) class GnuObjCPPCompiler(ObjCPPCompiler): - std_warn_args = ['-Wall', '-Wpedantic', '-Winvalid-pch'] std_opt_args = ['-O2'] def __init__(self, exelist, version, is_cross, exe_wrapper=None): @@ -1116,9 +1111,9 @@ class GnuObjCPPCompiler(ObjCPPCompiler): # Not really correct, but GNU objc is only used on non-OSX non-win. File a bug # if this breaks your use case. self.gcc_type = GCC_STANDARD - - def get_std_warn_args(self): - return GnuObjCPPCompiler.std_warn_args + self.warn_args = {'1': ['-Wall', '-Winvalid-pch', '-Wnon-virtual-dtor'], + '2': ['-Wall', '-Wpedantic', '-Winvalid-pch', '-Wnon-virtual-dtor'], + '3' : ['-Wall', '-Wpedantic', '-Wextra', '-Winvalid-pch', '-Wnon-virtual-dtor']} def get_buildtype_args(self, buildtype): return gnulike_buildtype_args[buildtype] @@ -1148,9 +1143,9 @@ class ClangCCompiler(CCompiler): def __init__(self, exelist, version, is_cross, exe_wrapper=None): CCompiler.__init__(self, exelist, version, is_cross, exe_wrapper) self.id = 'clang' - - def get_std_warn_args(self): - return ClangCCompiler.std_warn_args + self.warn_args = {'1': ['-Wall', '-Winvalid-pch'], + '2': ['-Wall', '-Wpedantic', '-Winvalid-pch'], + '3' : ['-Weverything']} def get_buildtype_args(self, buildtype): return gnulike_buildtype_args[buildtype] @@ -1172,8 +1167,6 @@ class ClangCCompiler(CCompiler): class GnuCPPCompiler(CPPCompiler): - new_warn = ['-Wall', '-Wpedantic', '-Winvalid-pch', '-Wnon-virtual-dtor'] - old_warn = ['-Wall', '-pedantic', '-Winvalid-pch', '-Wnon-virtual-dtor'] # may need to separate the latter to extra_debug_args or something std_debug_args = ['-g'] @@ -1181,17 +1174,13 @@ class GnuCPPCompiler(CPPCompiler): CPPCompiler.__init__(self, exelist, version, is_cross, exe_wrap) self.id = 'gcc' self.gcc_type = gcc_type - if mesonlib.version_compare(version, ">=4.9.0"): - self.warn_args= GnuCPPCompiler.new_warn - else: - self.warn_args = GnuCPPCompiler.old_warn + self.warn_args = {'1': ['-Wall', '-Winvalid-pch'], + '2': ['-Wall', '-Wpedantic', '-Winvalid-pch', '-Wnon-virtual-dtor'], + '3': ['-Wall', '-Wpedantic', '-Wextra', '-Winvalid-pch', '-Wnon-virtual-dtor']} def get_always_args(self): return ['-pipe'] - def get_std_warn_args(self): - return self.warn_args - def get_buildtype_args(self, buildtype): return gnulike_buildtype_args[buildtype] @@ -1205,14 +1194,12 @@ class GnuCPPCompiler(CPPCompiler): return get_gcc_soname_args(self.gcc_type, shlib_name, path, soversion) class ClangCPPCompiler(CPPCompiler): - std_warn_args = ['-Wall', '-Wpedantic', '-Winvalid-pch', '-Wnon-virtual-dtor'] - def __init__(self, exelist, version, is_cross, exe_wrapper=None): CPPCompiler.__init__(self, exelist, version, is_cross, exe_wrapper) self.id = 'clang' - - def get_std_warn_args(self): - return ClangCPPCompiler.std_warn_args + self.warn_args = {'1': ['-Wall', '-Winvalid-pch', '-Wnon-virtual-dtor'], + '2': ['-Wall', '-Wpedantic', '-Winvalid-pch', '-Wnon-virtual-dtor'], + '3': ['-Weverything']} def get_buildtype_args(self, buildtype): return gnulike_buildtype_args[buildtype] @@ -1230,8 +1217,6 @@ class ClangCPPCompiler(CPPCompiler): return ['-include-pch', os.path.join (pch_dir, self.get_pch_name (header))] class FortranCompiler(): - std_warn_args = ['-Wall'] - def __init__(self, exelist, version,is_cross, exe_wrapper=None): super().__init__() self.exelist = exelist @@ -1289,7 +1274,7 @@ end program prog def get_linker_always_args(self): return [] - def get_std_warn_args(self): + def get_std_warn_args(self, level): return FortranCompiler.std_warn_args def get_buildtype_args(self, buildtype): @@ -1348,6 +1333,10 @@ end program prog def module_name_to_filename(self, module_name): return module_name.lower() + '.mod' + def get_warn_args(self, level): + return ['-Wall'] + + class GnuFortranCompiler(FortranCompiler): def __init__(self, exelist, version, gcc_type, is_cross, exe_wrapper=None): super().__init__(exelist, version, is_cross, exe_wrapper=None) @@ -1373,7 +1362,7 @@ class SunFortranCompiler(FortranCompiler): def get_always_args(self): return [] - def get_std_warn_args(self): + def get_warn_args(self): return [] def get_module_outdir_args(self, path): @@ -1398,7 +1387,7 @@ class IntelFortranCompiler(FortranCompiler): return True return False - def get_std_warn_args(self): + def get_warn_args(self, level): return IntelFortranCompiler.std_warn_args class PathScaleFortranCompiler(FortranCompiler): @@ -1420,7 +1409,7 @@ class PathScaleFortranCompiler(FortranCompiler): return True return False - def get_std_warn_args(self): + def get_std_warn_args(self, level): return PathScaleFortranCompiler.std_warn_args class PGIFortranCompiler(FortranCompiler): @@ -1442,7 +1431,7 @@ class PGIFortranCompiler(FortranCompiler): return True return False - def get_std_warn_args(self): + def get_warn_args(self, level): return PGIFortranCompiler.std_warn_args @@ -1465,7 +1454,7 @@ class Open64FortranCompiler(FortranCompiler): return True return False - def get_std_warn_args(self): + def get_warn_args(self, level): return Open64FortranCompiler.std_warn_args class NAGFortranCompiler(FortranCompiler): @@ -1487,7 +1476,7 @@ class NAGFortranCompiler(FortranCompiler): return True return False - def get_std_warn_args(self): + def get_warn_args(self, level): return NAGFortranCompiler.std_warn_args -- cgit v1.2.3 From ad5795ed2e2afcd32d89fae68a8682fb647dd194 Mon Sep 17 00:00:00 2001 From: Jussi Pakkanen Date: Sat, 5 Sep 2015 15:03:20 +0300 Subject: Converted sizeof check to work also when cross compiling. --- compilers.py | 44 ++++++++++++++++++++++++-------------------- cross/iphone.txt | 4 ---- cross/ubuntu-armhf.txt | 4 ---- 3 files changed, 24 insertions(+), 28 deletions(-) (limited to 'compilers.py') diff --git a/compilers.py b/compilers.py index 1e778d379..56b2c8afc 100644 --- a/compilers.py +++ b/compilers.py @@ -261,8 +261,7 @@ int someSymbolHereJustForFun; ''' return self.compiles(templ % hname) - def compiles(self, code): - mlog.debug('Running compile test:\n\n', code) + def compiles(self, code, extra_args = []): suflen = len(self.default_suffix) (fd, srcname) = tempfile.mkstemp(suffix='.'+self.default_suffix) os.close(fd) @@ -270,8 +269,12 @@ int someSymbolHereJustForFun; ofile.write(code) ofile.close() commands = self.get_exelist() + commands += extra_args commands += self.get_compile_only_args() commands.append(srcname) + mlog.debug('Running compile test.') + mlog.debug('Command line: ', ' '.join(commands)) + mlog.debug('Code:\n', code) p = subprocess.Popen(commands, cwd=os.path.split(srcname)[0], stdout=subprocess.PIPE, stderr=subprocess.PIPE) (stde, stdo) = p.communicate() stde = stde.decode() @@ -325,7 +328,24 @@ int someSymbolHereJustForFun; os.remove(exename) return RunResult(True, pe.returncode, so, se) + def cross_sizeof(self, element, prefix, env): + templ = '''%s +int temparray[%d-sizeof(%s)]; +''' + extra_args = [] + try: + extra_args = env.cross_info.config['properties'][self.language + '_args'] + except KeyError: + pass + for i in range(1, 1024): + code = templ % (prefix, i, element) + if self.compiles(code, extra_args): + return i + raise EnvironmentException('Cross checking sizeof overflowed.') + def sizeof(self, element, prefix, env): + if self.is_cross: + return self.cross_sizeof(element, prefix, env) templ = '''#include %s @@ -334,23 +354,7 @@ int main(int argc, char **argv) { return 0; }; ''' - varname = 'sizeof ' + element - varname = varname.replace(' ', '_') - if self.is_cross: - val = env.cross_info.config['properties'][varname] - if val is not None: - if isinstance(val, int): - return val - raise EnvironmentException('Cross variable {0} is not an integer.'.format(varname)) - cross_failed = False - try: - res = self.run(templ % (prefix, element)) - except CrossNoRunException: - cross_failed = True - if cross_failed: - message = '''Can not determine size of {0} because cross compiled binaries are not runnable. -Please define the corresponding variable {1} in your cross compilation definition file.'''.format(element, varname) - raise EnvironmentException(message) + res = self.run(templ % (prefix, element)) if not res.compiled: raise EnvironmentException('Could not compile sizeof test.') if res.returncode != 0: @@ -414,7 +418,7 @@ int main(int argc, char **argv) { if val is not None: if isinstance(val, bool): return val - raise EnvironmentException('Cross variable {0} is not an boolean.'.format(varname)) + raise EnvironmentException('Cross variable {0} is not a boolean.'.format(varname)) return self.compiles(templ % (prefix, funcname)) def has_member(self, typename, membername, prefix): diff --git a/cross/iphone.txt b/cross/iphone.txt index 9fa44745e..b37a931af 100644 --- a/cross/iphone.txt +++ b/cross/iphone.txt @@ -16,10 +16,6 @@ cpp_args = ['-arch', 'armv7', '-miphoneos-version-min=8.0', '-isysroot', '/Appli c_link_args = ['-arch', 'armv7', '-miphoneos-version-min=8.0', '-isysroot', '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.4.sdk'] cpp_link_args = ['-arch', 'armv7', '-miphoneos-version-min=8.0', '-isysroot', '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.4.sdk'] -sizeof_int = 4 -sizeof_wchar_t = 4 -sizeof_void* = 4 - alignment_char = 1 alignment_void* = 4 alignment_double = 4 # Don't know if this is correct... diff --git a/cross/ubuntu-armhf.txt b/cross/ubuntu-armhf.txt index 196f2bf2c..e8bd91253 100644 --- a/cross/ubuntu-armhf.txt +++ b/cross/ubuntu-armhf.txt @@ -10,10 +10,6 @@ pkgconfig = '/usr/bin/arm-linux-gnueabihf-pkg-config' [properties] root = '/usr/arm-linux-gnueabihf' -sizeof_int = 4 -sizeof_wchar_t = 4 -sizeof_void* = 4 - alignment_char = 1 alignment_void* = 4 alignment_double = 4 # Don't know if this is correct... -- cgit v1.2.3 From 2e3bd006d319aca659cfbd8a31894e641a7a79e6 Mon Sep 17 00:00:00 2001 From: Jussi Pakkanen Date: Sat, 5 Sep 2015 15:17:02 +0300 Subject: Converted alignment check to work also when cross compiling. --- compilers.py | 39 ++++++++++++++++++++++----------------- cross/iphone.txt | 4 ---- cross/ubuntu-armhf.txt | 4 ---- 3 files changed, 22 insertions(+), 25 deletions(-) (limited to 'compilers.py') diff --git a/compilers.py b/compilers.py index 56b2c8afc..f457cf340 100644 --- a/compilers.py +++ b/compilers.py @@ -361,7 +361,28 @@ int main(int argc, char **argv) { raise EnvironmentException('Could not run sizeof test binary.') return int(res.stdout) + def cross_alignment(self, typename, env): + templ = '''#include +struct tmp { + char c; + %s target; +}; + +int testarray[%d-offsetof(struct tmp, target)]; +''' + try: + extra_args = env.cross_info.config['properties'][self.language + '_args'] + except KeyError: + pass + for i in range(1, 1024): + code = templ % (typename, i) + if self.compiles(code, extra_args): + return i + raise EnvironmentException('Cross checking offsetof overflowed.') + def alignment(self, typename, env): + if self.is_cross: + return self.cross_alignment(typename, env) templ = '''#include #include @@ -375,23 +396,7 @@ int main(int argc, char **argv) { return 0; } ''' - varname = 'alignment ' + typename - varname = varname.replace(' ', '_') - if self.is_cross: - val = env.cross_info.config['properties'][varname] - if val is not None: - if isinstance(val, int): - return val - raise EnvironmentException('Cross variable {0} is not an integer.'.format(varname)) - cross_failed = False - try: - res = self.run(templ % typename) - except CrossNoRunException: - cross_failed = True - if cross_failed: - message = '''Can not determine alignment of {0} because cross compiled binaries are not runnable. -Please define the corresponding variable {1} in your cross compilation definition file.'''.format(typename, varname) - raise EnvironmentException(message) + res = self.run(templ % typename) if not res.compiled: raise EnvironmentException('Could not compile alignment test.') if res.returncode != 0: diff --git a/cross/iphone.txt b/cross/iphone.txt index b37a931af..de485510a 100644 --- a/cross/iphone.txt +++ b/cross/iphone.txt @@ -16,10 +16,6 @@ cpp_args = ['-arch', 'armv7', '-miphoneos-version-min=8.0', '-isysroot', '/Appli c_link_args = ['-arch', 'armv7', '-miphoneos-version-min=8.0', '-isysroot', '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.4.sdk'] cpp_link_args = ['-arch', 'armv7', '-miphoneos-version-min=8.0', '-isysroot', '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.4.sdk'] -alignment_char = 1 -alignment_void* = 4 -alignment_double = 4 # Don't know if this is correct... - has_function_printf = true has_function_hfkerhisadf = false diff --git a/cross/ubuntu-armhf.txt b/cross/ubuntu-armhf.txt index e8bd91253..d15780eaf 100644 --- a/cross/ubuntu-armhf.txt +++ b/cross/ubuntu-armhf.txt @@ -10,10 +10,6 @@ pkgconfig = '/usr/bin/arm-linux-gnueabihf-pkg-config' [properties] root = '/usr/arm-linux-gnueabihf' -alignment_char = 1 -alignment_void* = 4 -alignment_double = 4 # Don't know if this is correct... - has_function_printf = true has_function_hfkerhisadf = false -- cgit v1.2.3 From 4dd6a85075703733f1f610df650b82879b911be7 Mon Sep 17 00:00:00 2001 From: Jussi Pakkanen Date: Sun, 6 Sep 2015 16:35:55 +0300 Subject: Fix Windows again. --- compilers.py | 3 ++- ninjabackend.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'compilers.py') diff --git a/compilers.py b/compilers.py index f457cf340..95582c94c 100644 --- a/compilers.py +++ b/compilers.py @@ -1049,7 +1049,8 @@ def get_gcc_soname_args(gcc_type, shlib_name, path, soversion): sostr = '' else: sostr = '.' + soversion - if gcc_type == GCC_STANDARD: + if gcc_type == GCC_STANDARD or gcc_type == GCC_MINGW: + # Might not be correct for mingw but seems to work. return ['-Wl,-soname,lib%s.so%s' % (shlib_name, sostr)] elif gcc_type == GCC_OSX: return ['-install_name', os.path.join(path, 'lib' + shlib_name + '.dylib')] diff --git a/ninjabackend.py b/ninjabackend.py index be4277d97..0bc500dca 100644 --- a/ninjabackend.py +++ b/ninjabackend.py @@ -1402,7 +1402,7 @@ rule FORTRAN_DEP_HACK basename = target.get_filename() aliases = target.get_aliaslist() aliascmd = [] - if shutil.which('ln'): + if not mesonlib.is_windows(): for alias in aliases: aliasfile = os.path.join(self.environment.get_build_dir(), outdir, alias) try: -- cgit v1.2.3 From 776f899e78e88600f34176ef4088c32208802777 Mon Sep 17 00:00:00 2001 From: Jussi Pakkanen Date: Sun, 6 Sep 2015 18:38:27 +0300 Subject: Made boost on windows kinda work. --- compilers.py | 6 ++-- dependencies.py | 56 +++++++++++++++++++++++++++++-- mesonlib.py | 5 ++- ninjabackend.py | 1 - test cases/frameworks/1 boost/meson.build | 2 ++ 5 files changed, 62 insertions(+), 8 deletions(-) (limited to 'compilers.py') diff --git a/compilers.py b/compilers.py index 95582c94c..24853e181 100644 --- a/compilers.py +++ b/compilers.py @@ -925,9 +925,9 @@ class VisualStudioCCompiler(CCompiler): self.always_args = VisualStudioCCompiler.vs2013_always_args else: self.always_args = VisualStudioCCompiler.vs2010_always_args - self.std_warn_args = {'1': ['/W2'], - '2': ['/W3'], - '3': ['/w4']} + self.warn_args = {'1': ['/W2'], + '2': ['/W3'], + '3': ['/w4']} def get_always_args(self): return self.always_args diff --git a/dependencies.py b/dependencies.py index d47dac8b7..b3ca400ca 100644 --- a/dependencies.py +++ b/dependencies.py @@ -393,6 +393,7 @@ class BoostDependency(Dependency): def __init__(self, environment, kwargs): Dependency.__init__(self) self.name = 'boost' + self.libdir = '' try: self.boost_root = os.environ['BOOST_ROOT'] if not os.path.isabs(self.boost_root): @@ -400,9 +401,14 @@ class BoostDependency(Dependency): except KeyError: self.boost_root = None if self.boost_root is None: - self.incdir = '/usr/include/boost' + if mesonlib.is_windows(): + self.boost_root = self.detect_win_root() + self.incdir = os.path.join(self.boost_root, 'boost') + else: + self.incdir = '/usr/include/boost' else: self.incdir = os.path.join(self.boost_root, 'include/boost') + mlog.debug('Boost library root dir is', self.boost_root) self.src_modules = {} self.lib_modules = {} self.lib_modules_mt = {} @@ -422,10 +428,20 @@ class BoostDependency(Dependency): else: mlog.log("Dependency Boost (%s) found:" % module_str, mlog.red('NO')) + def detect_win_root(self): + globtext = 'c:\\local\\boost_*' + files = glob.glob(globtext) + if len(files) > 0: + return files[0] + return 'C:\\' + def get_compile_args(self): args = [] if self.boost_root is not None: - args.append('-I' + os.path.join(self.boost_root, 'include')) + if mesonlib.is_windows(): + args.append('-I' + self.boost_root) + else: + args.append('-I' + os.path.join(self.boost_root, 'include')) return args def get_requested(self, kwargs): @@ -472,6 +488,28 @@ class BoostDependency(Dependency): self.src_modules[os.path.split(entry)[-1]] = True def detect_lib_modules(self): + if mesonlib.is_windows(): + return self.detect_lib_modules_win() + return self.detect_lib_modules_nix() + + def detect_lib_modules_win(self): + if mesonlib.is_32bit(): + gl = 'lib32*' + else: + gl = 'lib64*' + libdir = glob.glob(os.path.join(self.boost_root, gl)) + if len(libdir) == 0: + return + libdir = libdir[0] + self.libdir = libdir + globber = 'boost_*-gd-*.lib' # FIXME + for entry in glob.glob(os.path.join(libdir, globber)): + (_, fname) = os.path.split(entry) + base = fname.split('_', 1)[1] + modname = base.split('-', 1)[0] + self.lib_modules_mt[modname] = fname + + def detect_lib_modules_nix(self): globber = 'libboost_*.so' # FIXME, make platform independent. if self.boost_root is None: libdirs = mesonlib.get_library_dirs() @@ -488,12 +526,24 @@ class BoostDependency(Dependency): else: self.lib_modules[name] = True - def get_link_args(self): + def get_win_link_args(self): args = [] if self.boost_root: # FIXME, these are in gcc format, not msvc. # On the other hand, so are the args that # pkg-config returns. + args.append('/LIBPATH:' + self.libdir) + for module in self.requested_modules: + module = BoostDependency.name2lib.get(module, module) + if module in self.lib_modules_mt: + args.append(self.lib_modules_mt[module]) + return args + + def get_link_args(self): + if mesonlib.is_windows(): + return self.get_win_link_args() + args = [] + if self.boost_root: args.append('-L' + os.path.join(self.boost_root, 'lib')) for module in self.requested_modules: module = BoostDependency.name2lib.get(module, module) diff --git a/mesonlib.py b/mesonlib.py index d199725f1..d7c40f475 100644 --- a/mesonlib.py +++ b/mesonlib.py @@ -14,7 +14,7 @@ """A library of random helper functionality.""" -import platform, subprocess, operator, os, shutil, re +import platform, subprocess, operator, os, shutil, re, sys from glob import glob @@ -79,6 +79,9 @@ def is_windows(): platname = platform.system().lower() return platname == 'windows' or 'mingw' in platname +def is_32bit(): + return not(sys.maxsize > 2**32) + def is_debianlike(): try: open('/etc/debian_version', 'r') diff --git a/ninjabackend.py b/ninjabackend.py index 0bc500dca..ebf0a9403 100644 --- a/ninjabackend.py +++ b/ninjabackend.py @@ -1401,7 +1401,6 @@ rule FORTRAN_DEP_HACK def generate_shlib_aliases(self, target, outdir): basename = target.get_filename() aliases = target.get_aliaslist() - aliascmd = [] if not mesonlib.is_windows(): for alias in aliases: aliasfile = os.path.join(self.environment.get_build_dir(), outdir, alias) diff --git a/test cases/frameworks/1 boost/meson.build b/test cases/frameworks/1 boost/meson.build index f1a7d0e7e..ceea81114 100644 --- a/test cases/frameworks/1 boost/meson.build +++ b/test cases/frameworks/1 boost/meson.build @@ -2,6 +2,8 @@ project('boosttest', 'cpp') if meson.get_compiler('cpp').get_id() != 'msvc' add_global_arguments('-std=c++11', language : 'cpp') +else + add_global_arguments('/EHsc', language : 'cpp') endif # We want to have multiple separate configurations of Boost -- cgit v1.2.3