diff options
author | Benjamin Redelings <benjamin.redelings@gmail.com> | 2018-02-01 12:55:19 -0500 |
---|---|---|
committer | Benjamin Redelings <benjamin.redelings@gmail.com> | 2018-02-07 13:36:23 -0500 |
commit | a517c657fa44f679ef49de70b4bb04c7b742a51a (patch) | |
tree | 3fc3fc3add35ada8141f1e633e300478e336acb9 | |
parent | 77494979237794702027bec7f8afb5f78e4cee47 (diff) | |
download | meson-a517c657fa44f679ef49de70b4bb04c7b742a51a.zip meson-a517c657fa44f679ef49de70b4bb04c7b742a51a.tar.gz meson-a517c657fa44f679ef49de70b4bb04c7b742a51a.tar.bz2 |
Compute abi tags for windows also.
-rw-r--r-- | mesonbuild/dependencies/misc.py | 52 |
1 files changed, 40 insertions, 12 deletions
diff --git a/mesonbuild/dependencies/misc.py b/mesonbuild/dependencies/misc.py index 91dedc8..507bc15 100644 --- a/mesonbuild/dependencies/misc.py +++ b/mesonbuild/dependencies/misc.py @@ -301,6 +301,46 @@ class BoostDependency(ExternalDependency): modname = modname[3:] return modname + def compiler_tag(self): + tag = None + if mesonlib.for_windows(self.want_cross, self.env): + comp_ts_version = self.env.detect_cpp_compiler(self.want_cross).get_toolset_version() + compiler_ts = comp_ts_version.split('.') + # FIXME - what about other compilers? + tag = 'vc{}{}'.format(compiler_ts[0], compiler_ts[1]) + + tag = '-' + tag + return tag + + def threading_tag(self): + if not self.is_multithreading: + return '' + + if mesonlib.for_darwin(self.want_cross, self.env): + # - Mac: requires -mt for multithreading, so should not fall back to non-mt libraries. + return '-mt' + elif mesonlib.for_windows(self.want_cross, self.env): + # - Windows: requires -mt for multithreading, so should not fall back to non-mt libraries. + return '-mt' + else: + # - Linux: leaves off -mt but libraries are multithreading-aware. + # - Cygwin: leaves off -mt but libraries are multithreading-aware. + return '' + + def version_tag(self): + return self.version.replace('.', '_') + + # FIXME - how to handle different distributions, e.g. for Mac? Currently we handle homebrew and macports, but not fink. + def abi_tag(self): + if mesonlib.for_windows(self.want_cross, self.env): + tag = self.compiler_tag() + self.threading_tag() + if self.is_debug: + tag = tag + '-gd' + tag = tag + self.version_tag() + else: + tag = self.threading_tag() + return tag + def detect_lib_modules_win(self): arch = detect_cpu_family(self.env.coredata.compilers) comp_ts_version = self.env.detect_cpp_compiler(self.want_cross).get_toolset_version() @@ -367,18 +407,6 @@ class BoostDependency(ExternalDependency): fname = os.path.basename(entry) self.lib_modules[self.modname_from_filename(fname)] = [fname] - # - Linux leaves off -mt but libraries are multithreading-aware. - # - Cygwin leaves off -mt but libraries are multithreading-aware. - # - Mac requires -mt for multithreading, so should not fall back - # to non-mt libraries. - def abi_tag(self): - if mesonlib.for_windows(self.want_cross, self.env): - return None - if self.is_multithreading and mesonlib.for_darwin(self.want_cross, self.env): - return '-mt' - else: - return '' - def detect_lib_modules_nix(self): all_found = True for module in self.requested_modules: |