diff options
author | Peter Harris <pharris@opentext.com> | 2020-05-08 19:06:05 -0400 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2020-10-14 19:35:28 +0300 |
commit | 8b8a610ea4ed632759b831606723d1cafa8920d7 (patch) | |
tree | f17fdb6172233d836fc3df17ff87292516f23dc6 /mesonbuild | |
parent | e36f713a7f5cc10d3f8adc7ae1c73ef6cce51082 (diff) | |
download | meson-8b8a610ea4ed632759b831606723d1cafa8920d7.zip meson-8b8a610ea4ed632759b831606723d1cafa8920d7.tar.gz meson-8b8a610ea4ed632759b831606723d1cafa8920d7.tar.bz2 |
vs: add static_from_buildtype to b_vscrt
Diffstat (limited to 'mesonbuild')
-rw-r--r-- | mesonbuild/backend/vs2010backend.py | 7 | ||||
-rw-r--r-- | mesonbuild/compilers/compilers.py | 2 | ||||
-rw-r--r-- | mesonbuild/compilers/d.py | 16 | ||||
-rw-r--r-- | mesonbuild/compilers/mixins/visualstudio.py | 15 |
4 files changed, 29 insertions, 11 deletions
diff --git a/mesonbuild/backend/vs2010backend.py b/mesonbuild/backend/vs2010backend.py index 08360d3..6edf36a 100644 --- a/mesonbuild/backend/vs2010backend.py +++ b/mesonbuild/backend/vs2010backend.py @@ -838,6 +838,13 @@ class Vs2010Backend(backends.Backend): else: ET.SubElement(type_config, 'UseDebugLibraries').text = 'false' ET.SubElement(clconf, 'RuntimeLibrary').text = 'MultiThreadedDLL' + elif vscrt_type.value == 'static_from_buildtype': + if self.buildtype == 'debug': + ET.SubElement(type_config, 'UseDebugLibraries').text = 'true' + ET.SubElement(clconf, 'RuntimeLibrary').text = 'MultiThreadedDebug' + else: + ET.SubElement(type_config, 'UseDebugLibraries').text = 'false' + ET.SubElement(clconf, 'RuntimeLibrary').text = 'MultiThreaded' elif vscrt_type.value == 'mdd': ET.SubElement(type_config, 'UseDebugLibraries').text = 'true' ET.SubElement(clconf, 'RuntimeLibrary').text = 'MultiThreadedDebugDLL' diff --git a/mesonbuild/compilers/compilers.py b/mesonbuild/compilers/compilers.py index fa1046a..fd3bdb7 100644 --- a/mesonbuild/compilers/compilers.py +++ b/mesonbuild/compilers/compilers.py @@ -289,7 +289,7 @@ base_options = {'b_pch': coredata.UserBooleanOption('Use precompiled headers', T 'b_bitcode': coredata.UserBooleanOption('Generate and embed bitcode (only macOS/iOS/tvOS)', False), 'b_vscrt': coredata.UserComboOption('VS run-time library type to use.', - ['none', 'md', 'mdd', 'mt', 'mtd', 'from_buildtype'], + ['none', 'md', 'mdd', 'mt', 'mtd', 'from_buildtype', 'static_from_buildtype'], 'from_buildtype'), } # type: OptionDictType diff --git a/mesonbuild/compilers/d.py b/mesonbuild/compilers/d.py index 630291a..95850ea 100644 --- a/mesonbuild/compilers/d.py +++ b/mesonbuild/compilers/d.py @@ -389,19 +389,25 @@ class DmdLikeCompilerMixin(CompilerMixinBase): if crt_val in self.mscrt_args: return self.mscrt_args[crt_val] - assert(crt_val == 'from_buildtype') + assert(crt_val in ['from_buildtype', 'static_from_buildtype']) + + dbg = 'mdd' + rel = 'md' + if crt_val == 'static_from_buildtype': + dbg = 'mtd' + rel = 'mt' # Match what build type flags used to do. if buildtype == 'plain': return [] elif buildtype == 'debug': - return self.mscrt_args['mdd'] + return self.mscrt_args[dbg] elif buildtype == 'debugoptimized': - return self.mscrt_args['md'] + return self.mscrt_args[rel] elif buildtype == 'release': - return self.mscrt_args['md'] + return self.mscrt_args[rel] elif buildtype == 'minsize': - return self.mscrt_args['md'] + return self.mscrt_args[rel] else: assert(buildtype == 'custom') raise EnvironmentException('Requested C runtime based on buildtype, but buildtype is "custom".') diff --git a/mesonbuild/compilers/mixins/visualstudio.py b/mesonbuild/compilers/mixins/visualstudio.py index 75ab635..3e8b8e3 100644 --- a/mesonbuild/compilers/mixins/visualstudio.py +++ b/mesonbuild/compilers/mixins/visualstudio.py @@ -362,18 +362,23 @@ class VisualStudioLikeCompiler(Compiler, metaclass=abc.ABCMeta): def get_crt_compile_args(self, crt_val: str, buildtype: str) -> T.List[str]: if crt_val in self.crt_args: return self.crt_args[crt_val] - assert(crt_val == 'from_buildtype') + assert(crt_val in ['from_buildtype', 'static_from_buildtype']) + dbg = 'mdd' + rel = 'md' + if crt_val == 'static_from_buildtype': + dbg = 'mtd' + rel = 'mt' # Match what build type flags used to do. if buildtype == 'plain': return [] elif buildtype == 'debug': - return self.crt_args['mdd'] + return self.crt_args[dbg] elif buildtype == 'debugoptimized': - return self.crt_args['md'] + return self.crt_args[rel] elif buildtype == 'release': - return self.crt_args['md'] + return self.crt_args[rel] elif buildtype == 'minsize': - return self.crt_args['md'] + return self.crt_args[rel] else: assert(buildtype == 'custom') raise mesonlib.EnvironmentException('Requested C runtime based on buildtype, but buildtype is "custom".') |