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/2468pull/2838/head
parent
2c1b45b2b2
commit
6f3e2a0a07
5 changed files with 27 additions and 1 deletions
@ -0,0 +1,11 @@ |
||||
|
||||
#include <iostream> |
||||
|
||||
extern "C" |
||||
int foo(); |
||||
|
||||
int main() { |
||||
std::cout << "Starting\n"; |
||||
std::cout << foo() << "\n"; |
||||
return 0; |
||||
} |
@ -0,0 +1,6 @@ |
||||
project('master', ['cpp']) |
||||
|
||||
foo = subproject('foo') |
||||
dep = foo.get_variable('foo_dep') |
||||
|
||||
executable('master', 'master.cpp', dependencies: dep) |
@ -0,0 +1,4 @@ |
||||
|
||||
int foo() { |
||||
return 42; |
||||
} |
@ -0,0 +1,5 @@ |
||||
project('foo', ['objc']) |
||||
|
||||
l = static_library('foo', 'foo.m') |
||||
|
||||
foo_dep = declare_dependency(link_with : l) |
Loading…
Reference in new issue