objc++: Add support for objcpp_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 18d2e7b91c
commit 50c81d267b
  1. 5
      mesonbuild/build.py
  2. 4
      test cases/objc/5 objc++ args/meson.build
  3. 16
      test cases/objc/5 objc++ args/prog.mm

@ -29,6 +29,7 @@ known_basic_kwargs = {'install': True,
'cpp_pch': True,
'c_args': True,
'objc_args': True,
'objcpp_args': True,
'cpp_args': True,
'cs_args': True,
'vala_args': True,
@ -632,6 +633,10 @@ class BuildTarget(Target):
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', '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