aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xtest cases/common/103 manygen/subdir/manygen.py3
-rw-r--r--test cases/common/103 manygen/subdir/meson.build13
2 files changed, 14 insertions, 2 deletions
diff --git a/test cases/common/103 manygen/subdir/manygen.py b/test cases/common/103 manygen/subdir/manygen.py
index 4fd2f25..8449dc3 100755
--- a/test cases/common/103 manygen/subdir/manygen.py
+++ b/test cases/common/103 manygen/subdir/manygen.py
@@ -9,6 +9,7 @@ import shutil, subprocess
with open(sys.argv[1]) as f:
funcname = f.readline().strip()
outdir = sys.argv[2]
+buildtype_args = sys.argv[3]
if not os.path.isdir(outdir):
print('Outdir does not exist.')
@@ -67,7 +68,7 @@ with open(tmpc, 'w') as f:
''' % funcname)
if is_vs:
- subprocess.check_call([compiler, '/nologo', '/c', '/Fo' + outo, tmpc])
+ subprocess.check_call([compiler, '/nologo', '/c', buildtype_args, '/Fo' + outo, tmpc])
else:
subprocess.check_call([compiler, '-c', '-o', outo, tmpc])
diff --git a/test cases/common/103 manygen/subdir/meson.build b/test cases/common/103 manygen/subdir/meson.build
index 5c5d763..3036899 100644
--- a/test cases/common/103 manygen/subdir/meson.build
+++ b/test cases/common/103 manygen/subdir/meson.build
@@ -1,6 +1,17 @@
gen = find_program('manygen.py')
+buildtype = get_option('buildtype')
+buildtype_args = '-Dfooxxx' # a useless compiler argument
if meson.get_compiler('c').get_id() == 'msvc'
+ # We need our manually generated code to use the same CRT as the executable.
+ # Taken from compilers.py since build files do not have access to this.
+ if buildtype == 'debug'
+ buildtype_args = '/MDd'
+ elif buildtype == 'debugoptimized'
+ buildtype_args = '/MDd'
+ elif buildtype == 'release'
+ buildtype_args = '/MD'
+ endif
outfiles = ['gen_func.lib', 'gen_func.c', 'gen_func.h', 'gen_func.o']
else
outfiles = ['gen_func.a', 'gen_func.c', 'gen_func.h', 'gen_func.o']
@@ -9,5 +20,5 @@ endif
generated = custom_target('manygen',
output : outfiles,
input : ['funcinfo.def'],
- command : [gen, '@INPUT@', '@OUTDIR@'],
+ command : [gen, '@INPUT@', '@OUTDIR@', buildtype_args],
)