[Issue 18641] VisualD - First 5 minutes - Improve experience adding .d files to existing C++ projects

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Apr 25 06:18:02 UTC 2018


https://issues.dlang.org/show_bug.cgi?id=18641

--- Comment #3 from Rainer Schuetze <r.sagitario at gmx.de> ---
(In reply to Manu from comment #2)
> Why don't we just amend the global C/C++ props and include the D lib paths
> the same as MS does for CRT paths? I don't think anyone will mind ;)

That's probably fine for the phobos library, but the dmd/ldc releases also come
with curl.lib, that might interfere with other people libs.

> The link comment thing is interesting. Why only in main? MSC definitely
> includes the runtime lib reference in every single .obj file it emits
> (unless compiling with /Zl). I feel like we should do the same thing.
> Have you had experience where the linker ignores it?

A static library created with dmd is made up of object files for every function
and data object (not 100% sure about the latter). Every one of these will have
to include the phobos reference ("/DEFAULTLIB:phobos64.lib") making for a
gigantic combined command line. Not sure this is desirable.

> 
> 
> > With static libraries this gets a bit more complicated as these settings must be propagated to the actual link step in a different project.
> 
> What does MSC do?
> I feel like we should probably just match MSC's patterns verbatim, with
> respect to link paths, embedding library references, etc.

MSC uses the internal linker directives, but the granularity is higher as there
is only one object file per source file.

I managed to pass the libraries to the linker when you add a D file (without
main) to the project that does the link.

For a static library with D modules, this needs to be propagated to the linker.
I think it is feasible as msbuild does something similar (extract info from
another project) with the library file names.

--


More information about the Digitalmars-d-bugs mailing list