www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.internals - Rename CppRuntime_* versions to actual cpp libraries

reply Johan <j j.nl> writes:
Hi all,
   There is unfortunately an error (!) in druntime CppRuntime 
version naming.

I think this arises from the wrong assumption that libstdc++ is 
bound to GCC and libc++ to clang. This is _not_ the case. For 
those in the know, it is actually very confusing to read 
`CppRuntime_Clang` in the code. "What is that?!" Clang works with 
both libstdc++ and libc++ and it very much depends on the 
OS/installation/user which library is actually used.

I had to find this bit in `d_do_test.d` to learn what it stands 
for:
```
     version (CppRuntime_Gcc)
         envData.cxxCompatFlags = " -L-lstdc++ -L--no-demangle";
     else version (CppRuntime_Clang)
         envData.cxxCompatFlags = " -L-lc++ -L--no-demangle";
```

Ah, ok, so `CppRuntime_Clang` stands for libc++.

Please, please rename
     `CppRuntime_Gcc` => `CppRuntime_libstdcpp`
     `CppRuntime_Clang` => `CppRuntime_libcpp`

The `-target` option should be fixed similarly, but please debate 
that separately elsewhere.

I am happy to submit the patch with the rename, _after_ I get 
your go-ahead that it will be merged.

Thank you very very much!
   Johan
May 04
parent Walter Bright <newshound2 digitalmars.com> writes:
Sounds good to me.
May 28