objc: Add support for objc_args keyword

This allows the user to pass additional flags for the objective-c
compiler.
pull/1843/head
Paulo Antonio Alvarez 8 years ago
parent 07f117e385
commit 18d2e7b91c
  1. 5
      mesonbuild/build.py
  2. 4
      test cases/objc/4 objc args/meson.build
  3. 11
      test cases/objc/4 objc args/prog.m

@ -28,6 +28,7 @@ known_basic_kwargs = {'install': True,
'c_pch': True,
'cpp_pch': True,
'c_args': True,
'objc_args': True,
'cpp_args': True,
'cs_args': True,
'vala_args': True,
@ -627,6 +628,10 @@ class BuildTarget(Target):
if not isinstance(valalist, list):
valalist = [valalist]
self.add_compiler_args('vala', valalist)
objclist = kwargs.get('objc_args', [])
if not isinstance(objclist, list):
objclist = [objclist]
self.add_compiler_args('objc', objclist)
fortranlist = kwargs.get('fortran_args', [])
if not isinstance(fortranlist, list):
fortranlist = [fortranlist]

@ -0,0 +1,4 @@
project('objective c args', 'objc')
exe = executable('prog', 'prog.m', objc_args : ['-DMESON_TEST'])
test('objective c args', exe)

@ -0,0 +1,11 @@
#import<stdio.h>
int main(int argc, char **argv)
{
#ifdef MESON_TEST
int x = 3;
#endif
printf("x = %d\n", x);
return 0;
}
Loading…
Cancel
Save