<div dir="ltr"><div dir="ltr"><br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Additional issue with this CMAKE_C_ARCHIVE_CREATE hack: it's ignored and reverts back to the default in link.txt when building a "pure assembly" library without any .c file. Adding an empty.c file works around the problem</div></blockquote><div><br></div><div>Much better than adding an empty .c file: CMAKE_ASM_ARCHIVE_CREATE (resp. CMAKE_CXX_ARCHIVE_CREATE).</div><div><br></div><div>Eventually I used:</div><div><br></div><div>foreach(lang ASM C CXX)<br> SET(CMAKE_${lang}_CREATE_STATIC_LIBRARY<br></div><div><br></div><div>For the more general issue 2. below I filed <a href="https://gitlab.kitware.com/cmake/cmake/issues/19474">https://gitlab.kitware.com/cmake/cmake/issues/19474</a></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Is this expected? Reproduced with CMake 3.13 and 3.14.0.</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le lun. 25 févr. 2019 à 11:41, Marc Herbert <<a href="mailto:marc.herbert@gmail.com" target="_blank">marc.herbert@gmail.com</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr">Hi,<div><br></div><div>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?</div><div><br></div><div>2. Bonus question: how would you query "ar" and append some extra flags *only* when ar/ranlib are new enough to support them?</div><div><br></div><div>Thanks in advance,</div><div><br></div><div>Marc</div><div><br></div><div><div>SET(CMAKE_C_ARCHIVE_CREATE "<CMAKE_AR> -qcD <TARGET> <LINK_FLAGS> <OBJECTS>")</div><div>SET(CMAKE_C_ARCHIVE_FINISH "<CMAKE_RANLIB> -D <TARGET>")</div></div><div><br></div></div></div>
</blockquote></div>
</blockquote></div></div>