alliedmodders / ambuild

AlliedModders C++ Build System
BSD 3-Clause "New" or "Revised" License
60 stars 31 forks source link

Add helpers for ld/link.exe and ar/lib.exe #142

Closed dvander closed 2 years ago

dvander commented 2 years ago

AMBuild makes it difficult to create both a static and dynamic library from the same object files. Initially, my thought was to make it automatic, but it's a bit difficult because a library may have multiple archives as input, and it's not easy to transitively build a new archive with the current API.

Rather than get too far into the weeds with this, we instead attach "linker" and "archiver" objects as part of DetectCxx(). There are also "linker_argv" and "archiver_argv" variables for manually invoking them.

If AMBuild can't detect both the "ld" and "ar" parts of the toolchain, configuration fails.