Merge pull request #1843 from alvarez86/objcxx_args

Add support for objc_args and objcpp_args
pull/1851/head
Jussi Pakkanen 8 years ago committed by GitHub
commit fe84a6f43f
  1. 10
      mesonbuild/build.py
  2. 4
      test cases/objc/4 objc args/meson.build
  3. 11
      test cases/objc/4 objc args/prog.m
  4. 4
      test cases/objc/5 objc++ args/meson.build
  5. 16
      test cases/objc/5 objc++ args/prog.mm

@ -28,6 +28,8 @@ known_basic_kwargs = {'install': True,
'c_pch': True,
'cpp_pch': True,
'c_args': True,
'objc_args': True,
'objcpp_args': True,
'cpp_args': True,
'cs_args': True,
'vala_args': True,
@ -627,6 +629,14 @@ 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)
objcpplist = kwargs.get('objcpp_args', [])
if not isinstance(objcpplist, list):
objcpplist = [objcpplist]
self.add_compiler_args('objcpp', objcpplist)
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;
}

@ -0,0 +1,4 @@
project('objective c++ args', 'objcpp')
exe = executable('prog', 'prog.mm', objcpp_args : ['-DMESON_OBJCPP_TEST'])
test('objective c++ args', exe)

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