<div dir="ltr">This patch causes `execute_process` to dump the standard error if the command fails. This causes<div>the llvm-config help message to be printed as part of CMake configuration, which is ugly and incorrect.</div><div><br></div><div>I've already fixed this for libc++, libc++abi, and libunwind trunk, but the issue still exists in the release branch.</div><div><br></div><div>Please test before committing next time.</div><div><br></div><div>/Eric</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jan 9, 2017 at 4:41 PM, Michal Gorny via cfe-commits <span dir="ltr"><<a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: mgorny<br>
Date: Mon Jan 9 17:41:38 2017<br>
New Revision: 291508<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=291508&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project?rev=291508&view=rev</a><br>
Log:<br>
[cmake] Obtain LLVM_CMAKE_PATH from llvm-config if available<br>
<br>
Use the new --cmakedir option to obtain LLVM_CMAKE_PATH straight from<br>
llvm-config. Fallback to local reconstruction if llvm-config does not<br>
support this option.<br>
<br>
<br>
Modified:<br>
libcxx/trunk/cmake/Modules/<wbr>HandleOutOfTreeLLVM.cmake<br>
<br>
Modified: libcxx/trunk/cmake/Modules/<wbr>HandleOutOfTreeLLVM.cmake<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/libcxx/trunk/cmake/Modules/HandleOutOfTreeLLVM.cmake?rev=291508&r1=291507&r2=291508&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/libcxx/trunk/cmake/<wbr>Modules/HandleOutOfTreeLLVM.<wbr>cmake?rev=291508&r1=291507&r2=<wbr>291508&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- libcxx/trunk/cmake/Modules/<wbr>HandleOutOfTreeLLVM.cmake (original)<br>
+++ libcxx/trunk/cmake/Modules/<wbr>HandleOutOfTreeLLVM.cmake Mon Jan 9 17:41:38 2017<br>
@@ -38,7 +38,18 @@ macro(find_llvm_parts)<br>
set(LLVM_INCLUDE_DIR ${INCLUDE_DIR} CACHE PATH "Path to llvm/include")<br>
set(LLVM_BINARY_DIR ${LLVM_OBJ_ROOT} CACHE PATH "Path to LLVM build tree")<br>
set(LLVM_MAIN_SRC_DIR ${MAIN_SRC_DIR} CACHE PATH "Path to LLVM source tree")<br>
- set(LLVM_CMAKE_PATH "${LLVM_BINARY_DIR}/lib${LLVM_<wbr>LIBDIR_SUFFIX}/cmake/llvm")<br>
+<br>
+ # --cmakedir is supported since llvm r291218 (4.0 release)<br>
+ execute_process(<br>
+ COMMAND ${LLVM_CONFIG_PATH} --cmakedir<br>
+ RESULT_VARIABLE HAD_ERROR<br>
+ OUTPUT_VARIABLE CONFIG_OUTPUT)<br>
+ if(NOT HAD_ERROR)<br>
+ string(STRIP "${CONFIG_OUTPUT}" LLVM_CMAKE_PATH)<br>
+ else()<br>
+ set(LLVM_CMAKE_PATH<br>
+ "${LLVM_BINARY_DIR}/lib${LLVM_<wbr>LIBDIR_SUFFIX}/cmake/llvm")<br>
+ endif()<br>
else()<br>
set(LLVM_FOUND OFF)<br>
message(WARNING "UNSUPPORTED LIBCXX CONFIGURATION DETECTED: "<br>
<br>
<br>
______________________________<wbr>_________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@lists.llvm.org">cfe-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/cfe-commits</a><br>
</blockquote></div><br></div>