[CMake] Better way than: SET(CMAKE_C_ARCHIVE_CREATE "<CMAKE_AR> my_flags ... ?

Marc Herbert marc.herbert at gmail.com
Mon Feb 25 14:41:07 EST 2019


Hi,

1.  I found the hack below in the list's archive. However it seems...
hackish. Among others it can't _append_ a flag, it can only replace all
flags. Any newer and better way to append some extra flags?

2. Bonus question: how would you query "ar" and append some extra flags
*only* when ar/ranlib are new enough to support them?

Thanks in advance,

Marc

SET(CMAKE_C_ARCHIVE_CREATE "<CMAKE_AR> -qcD <TARGET> <LINK_FLAGS>
<OBJECTS>")
SET(CMAKE_C_ARCHIVE_FINISH "<CMAKE_RANLIB> -D <TARGET>")
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cmake.org/pipermail/cmake/attachments/20190225/3358047a/attachment.html>


More information about the CMake mailing list