1gen = files('manygen.py') 2py3_bin = import('python3').find_python() 3 4buildtype = get_option('buildtype') 5buildtype_args = '-Dfooxxx' # a useless compiler argument 6cc = meson.get_compiler('c') 7if cc.get_argument_syntax() == 'msvc' 8 # We need our manually generated code to use the same CRT as the executable. 9 # Taken from compilers.py since build files do not have access to this. 10 if buildtype == 'debug' 11 buildtype_args = '/MDd' 12 elif buildtype == 'debugoptimized' 13 buildtype_args = '/MDd' 14 elif buildtype == 'release' 15 buildtype_args = '/MD' 16 endif 17 outfiles = ['gen_func.lib', 'gen_func.c', 'gen_func.h', 'gen_func.o'] 18else 19 outfiles = ['gen_func.a', 'gen_func.c', 'gen_func.h', 'gen_func.o'] 20endif 21 22generated = custom_target('manygen', 23 output : outfiles, 24 input : ['funcinfo.def'], 25 command : [py3_bin, gen[0], '@INPUT@', '@OUTDIR@', buildtype_args, cc.get_argument_syntax(), cc.cmd_array()], 26) 27