Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
LDC: Apply dflags affecting symbol visibility to all deps
Example scenarios on Windows: * If an .exe is linked against druntime/Phobos DLLs (e.g., to enable loading other D DLLs, all sharing central druntime/Phobos), all static-lib dub dependencies need to be compiled with `-dllimport=defaultLibsOnly` too [the default with `-link-defaultlib-shared`]. * To make large DLLs with few selective `export`ed symbols work after #2412, the implicit flags need to be overridden - for the DLL itself and all its static-lib dependencies. This can currently only be accomplished by setting the DFLAGS environment variable. This PR enables overriding these `dflags` either in the DLL root project/ config directly, or in some dependency shared by multiple DLLs/ executables. E.g., at Symmetry, we have an .exe with lots of plugin DLLs. All plugins and the .exe have a shared dependency, so adding `dflags "-fvisibility=hidden" "-dllimport=defaultLibsOnly" platform="windows-ldc"` once in the dub.sdl of that shared dependency suffices to compile *everything* with those required flags.
- Loading branch information