aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/compilers
diff options
context:
space:
mode:
authorPeter Harris <pharris@opentext.com>2020-05-08 19:06:05 -0400
committerJussi Pakkanen <jpakkane@gmail.com>2020-10-14 19:35:28 +0300
commit8b8a610ea4ed632759b831606723d1cafa8920d7 (patch)
treef17fdb6172233d836fc3df17ff87292516f23dc6 /mesonbuild/compilers
parente36f713a7f5cc10d3f8adc7ae1c73ef6cce51082 (diff)
downloadmeson-8b8a610ea4ed632759b831606723d1cafa8920d7.zip
meson-8b8a610ea4ed632759b831606723d1cafa8920d7.tar.gz
meson-8b8a610ea4ed632759b831606723d1cafa8920d7.tar.bz2
vs: add static_from_buildtype to b_vscrt
Diffstat (limited to 'mesonbuild/compilers')
-rw-r--r--mesonbuild/compilers/compilers.py2
-rw-r--r--mesonbuild/compilers/d.py16
-rw-r--r--mesonbuild/compilers/mixins/visualstudio.py15
3 files changed, 22 insertions, 11 deletions
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".')