<div dir="ltr">I've used instructions on the website and it worked for me (setting Clang in CC= CXX= env vars before CMake invocation seems fine).</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Feb 7, 2013 at 3:22 AM, Howard Hinnant <span dir="ltr"><<a href="mailto:hhinnant@apple.com" target="_blank">hhinnant@apple.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Because of:<br>
<br>
<a href="http://llvm.org/bugs/show_bug.cgi?id=15182" target="_blank">http://llvm.org/bugs/show_bug.cgi?id=15182</a><br>
<br>
I am asking for a review of the CMake building instructions on the libcxx website:<br>
<br>
<a href="http://libcxx.llvm.org" target="_blank">http://libcxx.llvm.org</a><br>
<br>
I have no clue if our website is right or wrong. I just want somebody in the know to double check.<br>
<br>
Thanks much.<br>
<span class="HOEnZb"><font color="#888888"><br>
Howard<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
On Dec 31, 2012, at 2:34 PM, Michael J. Spencer <<a href="mailto:bigcheesegs@gmail.com">bigcheesegs@gmail.com</a>> wrote:<br>
<br>
> Author: mspencer<br>
> Date: Mon Dec 31 13:34:21 2012<br>
> New Revision: 171316<br>
><br>
> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=171316&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=171316&view=rev</a><br>
> Log:<br>
> [CMake] Fix c++ abi library configuration on Linux.<br>
><br>
> You can now configure from the command line using:<br>
> -DLIBCXX_CXX_ABI=libsupc++<br>
> -DLIBCXX_LIBSUPCXX_INCLUDE_PATHS="path;path<br>
><br>
> Also documents how to build on Linux.<br>
><br>
> Modified:<br>
> libcxx/trunk/CMakeLists.txt<br>
> libcxx/trunk/lib/CMakeLists.txt<br>
> libcxx/trunk/www/index.html<br>
><br>
> Modified: libcxx/trunk/CMakeLists.txt<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/libcxx/trunk/CMakeLists.txt?rev=171316&r1=171315&r2=171316&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/libcxx/trunk/CMakeLists.txt?rev=171316&r1=171315&r2=171316&view=diff</a><br>
> ==============================================================================<br>
> --- libcxx/trunk/CMakeLists.txt (original)<br>
> +++ libcxx/trunk/CMakeLists.txt Mon Dec 31 13:34:21 2012<br>
> @@ -40,6 +40,9 @@<br>
> option(LIBCXX_ENABLE_SHARED "Build libc++ as a shared library." ON)<br>
><br>
> set(CXXABIS none libcxxabi libcxxrt libsupc++)<br>
> +if (NOT DEFINED LIBCXX_CXX_ABI)<br>
> + set(LIBCXX_CXX_ABI "none")<br>
> +endif()<br>
> set(LIBCXX_CXX_ABI "${LIBCXX_CXX_ABI}" CACHE STRING<br>
> "Specify C++ ABI library to use." FORCE)<br>
> set_property(CACHE LIBCXX_CXX_ABI PROPERTY STRINGS "";${CXXABIS})<br>
> @@ -63,9 +66,10 @@<br>
> )<br>
> set(LIBCXX_TARGET_TRIPLE ${LIBCXX_TARGET_TRIPLE} CACHE STRING "Target triple.")<br>
><br>
> -if (${LIBCXX_CXX_ABI} STREQUAL "libsupc++")<br>
> - set(LIBCXX_LIBSUPCXX_INCLUDE_PATHS "" CACHE STRINGS<br>
> - "Paths to libsupc++ include directories. Separate by system separator")<br>
> +if ("${LIBCXX_CXX_ABI}" STREQUAL "libsupc++")<br>
> + set(LIBCXX_LIBSUPCXX_INCLUDE_PATHS "${LIBCXX_LIBSUPCXX_INCLUDE_PATHS}"<br>
> + CACHE STRINGS<br>
> + "Paths to libsupc++ include directories separate by ';'.")<br>
> set(LIBCXX_CXX_ABI_LIBRARIES stdc++)<br>
> set(LIBCXX_LIBSUPCXX_FILES<br>
> cxxabi.h<br>
> @@ -75,6 +79,9 @@<br>
> bits/cxxabi_tweaks.h<br>
> bits/cxxabi_forced.h<br>
> )<br>
> + # Create include directories.<br>
> + file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/include")<br>
> + file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/include/bits")<br>
> set(LIBCXX_LIBSUPCXX_FILE_PATHS)<br>
> foreach(path ${LIBCXX_LIBSUPCXX_FILES})<br>
> set(found FALSE)<br>
> @@ -106,7 +113,7 @@<br>
> FILES_MATCHING<br>
> PATTERN "*"<br>
> )<br>
> -elseif (${LIBCXX_CXX_ABI} NOT STREQUAL "none")<br>
> +elseif (NOT "${LIBCXX_CXX_ABI}" STREQUAL "none")<br>
> message(FATAL_ERROR<br>
> "Currently only none and libsupc++ are supported for c++ abi.")<br>
> endif ()<br>
><br>
> Modified: libcxx/trunk/lib/CMakeLists.txt<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/libcxx/trunk/lib/CMakeLists.txt?rev=171316&r1=171315&r2=171316&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/libcxx/trunk/lib/CMakeLists.txt?rev=171316&r1=171315&r2=171316&view=diff</a><br>
> ==============================================================================<br>
> --- libcxx/trunk/lib/CMakeLists.txt (original)<br>
> +++ libcxx/trunk/lib/CMakeLists.txt Mon Dec 31 13:34:21 2012<br>
> @@ -31,7 +31,9 @@<br>
> )<br>
> endif()<br>
><br>
> -add_dependencies(cxx ${LIBCXX_CXX_ABI_DEPS})<br>
> +if (DEFINED LIBCXX_CXX_ABI_DEPS)<br>
> + add_dependencies(cxx ${LIBCXX_CXX_ABI_DEPS})<br>
> +endif()<br>
><br>
> # Generate library list.<br>
> set(libraries ${LIBCXX_CXX_ABI_LIBRARIES})<br>
><br>
> Modified: libcxx/trunk/www/index.html<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/libcxx/trunk/www/index.html?rev=171316&r1=171315&r2=171316&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/libcxx/trunk/www/index.html?rev=171316&r1=171315&r2=171316&view=diff</a><br>
> ==============================================================================<br>
> --- libcxx/trunk/www/index.html (original)<br>
> +++ libcxx/trunk/www/index.html Mon Dec 31 13:34:21 2012<br>
> @@ -116,6 +116,7 @@<br>
> <!--=====================================================================--><br>
><br>
> <p>libc++ is a 100% complete C++11 implementation on Apple's OS X. </p><br>
> + <p>LLVM and Clang can self host in C++ and C++11 mode with libc++ on Linux.</p><br>
><br>
> <p><br>
> Ports to other platforms are underway. Here are recent test<br>
> @@ -205,6 +206,60 @@<br>
> (<a href="<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a>">clang mailing list</a>).</p><br>
><br>
> <!--=====================================================================--><br>
> + <h2>Build on Linux using CMake and libsupc++.</h2><br>
> + <!--=====================================================================--><br>
> +<br>
> + <p><br>
> + You will need libstdc++ in order to provide libsupc++.<br>
> + </p><br>
> +<br>
> + <p><br>
> + Figure out where the libsupc++ headers are on your system. On Ubuntu this<br>
> + is <code>/usr/include/c++/<version></code> and<br>
> + <code>/usr/include/c++/<version>/<target-triple></code><br>
> + </p><br>
> +<br>
> + <p><br>
> + You can also figure this out by running<br>
> + <pre><br>
> +$ echo | g++ -Wp,-v -x c++ - -fsyntax-only<br>
> +ignoring nonexistent directory "/usr/local/include/x86_64-linux-gnu"<br>
> +ignoring nonexistent directory "/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../x86_64-linux-gnu/include"<br>
> +#include "..." search starts here:<br>
> +#include <...> search starts here:<br>
> + /usr/include/c++/4.7<br>
> + /usr/include/c++/4.7/x86_64-linux-gnu<br>
> + /usr/include/c++/4.7/backward<br>
> + /usr/lib/gcc/x86_64-linux-gnu/4.7/include<br>
> + /usr/local/include<br>
> + /usr/lib/gcc/x86_64-linux-gnu/4.7/include-fixed<br>
> + /usr/include/x86_64-linux-gnu<br>
> + /usr/include<br>
> +End of search list.<br>
> + </pre><br>
> +<br>
> + Note the first two entries happen to be what we are looking for. This<br>
> + may not be correct on other platforms.<br>
> + </p><br>
> +<br>
> + <p><br>
> + We can now run CMake:<br>
> + <ul><br>
> + <li><code>CC=clang CXX=clang++ cmake -G "Unix Makefiles"<br>
> + -DLIBCXX_CXX_ABI=libsupc++<br>
> + -DLIBCXX_LIBSUPCXX_INCLUDE_PATHS="/usr/include/c++/4.7/;/usr/include/c++/4.7/x86_64-linux-gnu/"<br>
> + -DCMAKE_BUILD_TYPE=Release<br>
> + -DCMAKE_INSTALL_PREFIX=/usr<br>
> + <libc++-source-dir></code></li><br>
> + <li><code>make</code></li><br>
> + <li><code>sudo make install</code></li><br>
> + </ul><br>
> + <p><br>
> + You can now run clang with -stdlib=libc++.<br>
> + </p><br>
> + </p><br>
> +<br>
> + <!--=====================================================================--><br>
> <h2>Design Documents</h2><br>
> <!--=====================================================================--><br>
><br>
><br>
><br>
> _______________________________________________<br>
> cfe-commits mailing list<br>
> <a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
<br>
_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div>Alexey Samsonov, MSK</div>
</div>