diff options
author | Nirbheek Chauhan <nirbheek@centricular.com> | 2017-12-30 06:19:31 +0530 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2017-12-30 17:59:34 +0200 |
commit | 6f3e2a0a0753ad0a4fc84a74fdc6209f436d4371 (patch) | |
tree | 826ba710421b6d26b259e3627456622026bd77f0 /test cases/objc | |
parent | 2c1b45b2b22b8609f08265db2446323cd0a27fc0 (diff) | |
download | meson-6f3e2a0a0753ad0a4fc84a74fdc6209f436d4371.tar.gz |
compilers: prefer C++ over objc in clink_langs
Otherwise we will try to use the objc compiler when linking projects
with both objc and C++.
Technically we should use the objc++ linker when doing this, but on
most (all?) systems the objc++ linker is `c++`, which is the same
as the C++ linker.
Closes https://github.com/mesonbuild/meson/issues/2468
Diffstat (limited to 'test cases/objc')
4 files changed, 26 insertions, 0 deletions
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 000000000..2f351d1ca --- /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 000000000..8a77dedce --- /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 000000000..e193b8681 --- /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 000000000..2dbf8ab26 --- /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) |