<div dir="ltr"><div><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Aug 21, 2018 at 11:41 PM, Robert Dailey <span dir="ltr"><<a href="mailto:rcdailey.lists@gmail.com" target="_blank">rcdailey.lists@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">I'll explain a bit why I'm asking. I noticed that for code bases that<br>
work on Android plus other UNIX platforms, they unconditionally<br>
specify `-stdlib=libc++`, however this doesn't work on Ubuntu by<br>
default, which uses gnu stl + gcc/clang. So you get compiler errors.<br>
There's no way for me to "search" a platform to see if it is eligible<br>
for the libc++ flag, I simply have to either disable it completely or<br>
conditionally include it based on target platform and/or toolchain.<br>
None of these really address the root cause.<br>
<br>
I'm not even really sure what a find module for this would do... but<br>
typically find modules don't provide compiler flags, so I'm not sure<br>
if that's the right tool for the job. Would love to hear from the<br>
developers on this, so I've cross posted to the dev mailing list in<br>
this reply.<br></blockquote><div><br></div><div><br></div><div>Excuse the brevity, but it sounds like you might be looking for the CXX_EXTENSIONS target property (sorry if I've misunderstood your problem, let me know why it isn't appropriate if so). See the following article for a more complete overview of this and related properties:<div><br></div><div><a href="https://crascit.com/2015/03/28/enabling-cxx11-in-cmake/">https://crascit.com/2015/03/28/enabling-cxx11-in-cmake/</a><br></div></div><div><br></div><div><br></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">
<div><div class="gmail-h5">On Mon, Aug 20, 2018 at 10:05 PM Thompson, KT <<a href="mailto:kgt@lanl.gov">kgt@lanl.gov</a>> wrote:<br>
><br>
> I'm also interested in the answer to Robert's question. I've been using<br>
><br>
> set( CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -stdlib=libc++")<br>
><br>
> but it seems like there should be a more elegant approach.<br>
><br>
> -tk<br>
><br>
> -----Original Message-----<br>
> From: CMake <<a href="mailto:cmake-bounces@cmake.org">cmake-bounces@cmake.org</a>> On Behalf Of Robert Dailey<br>
> Sent: Monday, August 20, 2018 11:48 AM<br>
> To: CMake <<a href="mailto:cmake@cmake.org">cmake@cmake.org</a>><br>
> Subject: [CMake] libc++ usage in CMake with Clang?<br>
><br>
> Is the only way to use libc++ to muck with compile flags? Or is there a proper find module for this or something? Is there a more CMake-esque way of specifying the STL library to use with the toolchain?<br>
> --<br>
><br>
> Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
><br>
> Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" rel="noreferrer" target="_blank">http://www.cmake.org/Wiki/<wbr>CMake_FAQ</a><br>
><br>
> Kitware offers various services to support the CMake community. For more information on each offering, please visit:<br>
><br>
> CMake Support: <a href="http://cmake.org/cmake/help/support.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/<wbr>support.html</a><br>
> CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/<wbr>consulting.html</a><br>
> CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/<wbr>training.html</a><br>
><br>
> Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/<wbr>opensource/opensource.html</a><br>
><br>
> Follow this link to subscribe/unsubscribe:<br>
> <a href="https://cmake.org/mailman/listinfo/cmake" rel="noreferrer" target="_blank">https://cmake.org/mailman/<wbr>listinfo/cmake</a><br>
-- <br>
<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" rel="noreferrer" target="_blank">http://www.cmake.org/Wiki/<wbr>CMake_FAQ</a><br>
<br>
Kitware offers various services to support the CMake community. For more information on each offering, please visit:<br>
<br>
CMake Support: <a href="http://cmake.org/cmake/help/support.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/<wbr>support.html</a><br>
CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/<wbr>consulting.html</a><br>
CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/<wbr>training.html</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/<wbr>opensource/opensource.html</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
</div></div><a href="https://cmake.org/mailman/listinfo/cmake-developers" rel="noreferrer" target="_blank">https://cmake.org/mailman/<wbr>listinfo/cmake-developers</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr">Craig Scott<br><div>Melbourne, Australia</div><div><a href="https://crascit.com" target="_blank">https://crascit.com</a><br></div><div><br></div><div>New book released: <a href="https://crascit.com/professional-cmake/" target="_blank">Professional CMake: A Practical Guide</a><br></div></div></div></div></div></div></div>
</div></div>