Added (or, rather, brought back) the add_languages function.

pull/212/head
Jussi Pakkanen 10 years ago
parent fa74ef4c57
commit 5788f47952
  1. 6
      interpreter.py
  2. 7
      test cases/common/89 add language/meson.build
  3. 6
      test cases/common/89 add language/prog.c
  4. 6
      test cases/common/89 add language/prog.cc

@ -832,6 +832,7 @@ class Interpreter():
'configure_file' : self.func_configure_file,
'include_directories' : self.func_include_directories,
'add_global_arguments' : self.func_add_global_arguments,
'add_languages' : self.func_add_languages,
'find_program' : self.func_find_program,
'find_library' : self.func_find_library,
'configuration_data' : self.func_configuration_data,
@ -1174,6 +1175,11 @@ class Interpreter():
if not 'c' in langs:
raise InterpreterException('Compiling Vala requires a C compiler')
@noKwargs
@stringArgs
def func_add_languages(self, node, args, kwargs):
self.add_languages(node, args)
@noKwargs
def func_message(self, node, args, kwargs):
# reduce arguments again to avoid flattening posargs

@ -0,0 +1,7 @@
project('add language', 'c')
test('C', executable('cprog', 'prog.c'))
add_languages('cpp')
test('C++', executable('cppprog', 'prog.cc'))

@ -0,0 +1,6 @@
#include<stdio.h>
int main(int argc, char **argv) {
printf("I am plain C.\n");
return 0;
}

@ -0,0 +1,6 @@
#include<iostream>
int main(int, char**) {
std::cout << "I am C++.\n";
return 0;
}
Loading…
Cancel
Save