Mixed language projects (D and C++)

Max Haughton maxhaton at gmail.com
Fri Feb 19 10:21:29 UTC 2021


On Friday, 19 February 2021 at 10:18:28 UTC, Preetpal wrote:
> On Friday, 19 February 2021 at 10:01:36 UTC, Max Haughton wrote:
>> On Friday, 19 February 2021 at 09:44:15 UTC, Preetpal wrote:
>>> I want to reuse existing C++ code in a new project that I am 
>>> writing in D and I want to use D in an existing C++ code base 
>>> (it is not large). I do not anticipate interop being an issue.
>>>
>>> [...]
>>
>> C++ interop is used every day. The LLVM D compiler, ldc, uses 
>> it to talk to LLVM efficiently.
>>
>> There are good resources on it on this very website
>
> I am looking for suggestions on what build system to use. I 
> took a look at the LDC project but it looks they are writing 
> their own CMake scripts in the repository itself to add support 
> for D to CMake. I was hoping there might be something that 
> others were using with out of box support for D.

I would keep it simple and use the dub pregenerate step to run 
any old C++ build process then link as usual.


More information about the Digitalmars-d-learn mailing list