Add targets for release binaries? (1.3+)
Adrian Matoga via digitalmars-d-ldc
digitalmars-d-ldc at puremagic.com
Fri May 5 08:59:21 PDT 2017
On Friday, 5 May 2017 at 13:43:31 UTC, Johan Engelen wrote:
> On Friday, 5 May 2017 at 12:49:32 UTC, David Nadlinger wrote:
>> On 5 May 2017, at 9:52, Adrian Matoga via digitalmars-d-ldc
>> wrote:
>>> What I miss the most in LDC is the ability to build and use
>>> druntime/Phobos for different targets (including subtargets,
>>> e.g. different ARM architecture versions and ABIs) with the
>>> same compiler.
>
> Perhaps what would be nice is a script that we can ship with
> LDC, that then compiles Phobos/druntime with specific compiler
> options: target triple, LTO flag (!), ...
> LDC will be able to link libraries in the future, so the script
> will not have to deal with some of the platform issues.
>
> -Johan
Yes, and I believe the "script" is doable in a few lines inserted
in CMakeLists we already have. I need to improve my CMakese to
prove it.
For my target, I only had to change few things in
runtime/CMakeLists.txt: set CMAKE_C_COMPILER, and add -triple and
--sysroot.
I believe in most cases it'll be just a matter of iterating over
a list of targets, each having its specific flags and paths, and
for each of them rebuilding druntime and Phobos in a separate
directory.
The other part of it is using the LDC you've built this way
later. You should be able to conveniently specify which of these
targets you want. Technically, you can already use -mtriple,
-gcc, -defaultlib etc., but it could be made easier.
More information about the digitalmars-d-ldc
mailing list