Can combine D and C++ in a single target. Closes #3125.
parent
77b72e8573
commit
1918c0d231
10 changed files with 68 additions and 15 deletions
@ -0,0 +1,6 @@ |
||||
extern void print_hello(int i); |
||||
|
||||
int main(int, char**) { |
||||
print_hello(1); |
||||
return 0; |
||||
} |
@ -0,0 +1,5 @@ |
||||
extern (C++) void print_hello(int i); |
||||
|
||||
void main() { |
||||
print_hello(1); |
||||
} |
@ -0,0 +1,5 @@ |
||||
#include<iostream> |
||||
|
||||
void print_hello(int i) { |
||||
std::cout << "Hello. Here is a number printed with C++: " << i << ".\n"; |
||||
} |
@ -0,0 +1,5 @@ |
||||
import std.stdio; |
||||
|
||||
extern (C++) void print_hello(int i) { |
||||
writefln("Hello. Here is a number printed with D: %d", i); |
||||
} |
@ -0,0 +1,13 @@ |
||||
project('d and c++', 'd', 'cpp') |
||||
|
||||
cpp = meson.get_compiler('cpp') |
||||
|
||||
if cpp.get_id() == 'clang' |
||||
error('MESON_SKIP_TEST combining Clang C++ with GDC produces broken executables.') |
||||
endif |
||||
|
||||
e1 = executable('dcpp', 'dmain.d', 'libfile.cpp') |
||||
test('dcpp', e1) |
||||
|
||||
e2 = executable('cppd', 'cppmain.cpp', 'libfile.d') |
||||
test('cppd', e2) |
Loading…
Reference in new issue