diff options
5 files changed, 27 insertions, 1 deletions
diff --git a/mesonbuild/compilers/compilers.py b/mesonbuild/compilers/compilers.py index 24ae3c9..9728918 100644 --- a/mesonbuild/compilers/compilers.py +++ b/mesonbuild/compilers/compilers.py @@ -49,7 +49,7 @@ cpp_suffixes = lang_suffixes['cpp'] + ('h',) c_suffixes = lang_suffixes['c'] + ('h',) # List of languages that can be linked with C code directly by the linker # used in build.py:process_compilers() and build.py:get_dynamic_linker() -clike_langs = ('objcpp', 'objc', 'd', 'cpp', 'c', 'fortran',) +clike_langs = ('d', 'objcpp', 'cpp', 'objc', 'c', 'fortran',) clike_suffixes = () for _l in clike_langs: clike_suffixes += lang_suffixes[_l] diff --git a/test cases/objc/6 c++ project objc subproject/master.cpp b/test cases/objc/6 c++ project objc subproject/master.cpp new file mode 100644 index 0000000..2f351d1 --- /dev/null +++ b/test cases/objc/6 c++ project objc subproject/master.cpp @@ -0,0 +1,11 @@ + +#include <iostream> + +extern "C" +int foo(); + +int main() { + std::cout << "Starting\n"; + std::cout << foo() << "\n"; + return 0; +} diff --git a/test cases/objc/6 c++ project objc subproject/meson.build b/test cases/objc/6 c++ project objc subproject/meson.build new file mode 100644 index 0000000..8a77ded --- /dev/null +++ b/test cases/objc/6 c++ project objc subproject/meson.build @@ -0,0 +1,6 @@ +project('master', ['cpp']) + +foo = subproject('foo') +dep = foo.get_variable('foo_dep') + +executable('master', 'master.cpp', dependencies: dep) diff --git a/test cases/objc/6 c++ project objc subproject/subprojects/foo/foo.m b/test cases/objc/6 c++ project objc subproject/subprojects/foo/foo.m new file mode 100644 index 0000000..e193b86 --- /dev/null +++ b/test cases/objc/6 c++ project objc subproject/subprojects/foo/foo.m @@ -0,0 +1,4 @@ + +int foo() { + return 42; +} diff --git a/test cases/objc/6 c++ project objc subproject/subprojects/foo/meson.build b/test cases/objc/6 c++ project objc subproject/subprojects/foo/meson.build new file mode 100644 index 0000000..2dbf8ab --- /dev/null +++ b/test cases/objc/6 c++ project objc subproject/subprojects/foo/meson.build @@ -0,0 +1,5 @@ +project('foo', ['objc']) + +l = static_library('foo', 'foo.m') + +foo_dep = declare_dependency(link_with : l) |