[prev in list] [next in list] [prev in thread] [next in thread] 

List:       cmake
Subject:    [CMake] Better way than: SET(CMAKE_C_ARCHIVE_CREATE "<CMAKE_AR> my_flags ... ?
From:       Marc Herbert <marc.herbert () gmail ! com>
Date:       2019-02-25 19:41:07
Message-ID: CA+rkZbgsA4wi9ovyZmmp=CN_hasZrUMPhtXe+hLHuEqd70gL1Q () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


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>")

[Attachment #5 (text/html)]

<div dir="ltr"><div dir="ltr">Hi,<div><br></div><div>1.   I found the hack below in \
the list&#39;s archive. However it seems... hackish. Among others it can&#39;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 \
&quot;ar&quot; 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 \
&quot;&lt;CMAKE_AR&gt; -qcD &lt;TARGET&gt; &lt;LINK_FLAGS&gt; \
&lt;OBJECTS&gt;&quot;)</div><div>SET(CMAKE_C_ARCHIVE_FINISH \
&quot;&lt;CMAKE_RANLIB&gt; -D \
&lt;TARGET&gt;&quot;)</div></div><div><br></div></div></div>



-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: \
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information \
on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at \
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic