<div dir="ltr">Hi Zachery:<div><br></div><div>I'm seeing a breakage when cross-compiling and including libcxx in the runtimes directory.</div><div><br></div><div>The problem is that `include(AddLLVM)`, guarded by <span style="color:rgb(0,0,0);font-family:monospace;font-size:medium;white-space:pre">LIBCXX_INCLUDE_TESTS, </span>comes after your change to call `<span style="font-size:12.8px">configure_lit_site_cfg`.</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">I've fixed this locally by adding `include(AddLLVM)`  to the top of libcxx/test/CMakeLists.txt, but don't believe this is the correct fix.</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">Could you take a look?</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">thanks...</span></div><div><span style="font-size:12.8px">don</span></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Sep 19, 2017 at 10:19 AM, Zachary Turner 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: zturner<br>
Date: Tue Sep 19 10:19:10 2017<br>
New Revision: 313643<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=313643&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project?rev=313643&view=rev</a><br>
Log:<br>
Resubmit "Fix llvm-lit script generation in libcxx."<br>
<br>
After speaking with the libcxx owners, they agreed that this is<br>
a bug in the bot that needs to be fixed by the bot owners, and<br>
the CMake changes are correct.<br>
<br>
Modified:<br>
    libcxx/trunk/CMakeLists.txt<br>
    libcxx/trunk/cmake/Modules/<wbr>HandleOutOfTreeLLVM.cmake<br>
    libcxx/trunk/test/CMakeLists.<wbr>txt<br>
<br>
Modified: libcxx/trunk/CMakeLists.txt<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/libcxx/trunk/CMakeLists.txt?rev=313643&r1=313642&r2=313643&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/libcxx/trunk/<wbr>CMakeLists.txt?rev=313643&r1=<wbr>313642&r2=313643&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- libcxx/trunk/CMakeLists.txt (original)<br>
+++ libcxx/trunk/CMakeLists.txt Tue Sep 19 10:19:10 2017<br>
@@ -653,6 +653,7 @@ endif()<br>
 #<br>
 # However, since some submission systems strip test/ subdirectories, check for<br>
 # it before adding it.<br>
+<br>
 if(IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/<wbr>test")<br>
   add_subdirectory(test)<br>
 endif()<br>
@@ -660,6 +661,15 @@ if (LIBCXX_INCLUDE_TESTS)<br>
   add_subdirectory(lib/abi)<br>
 endif()<br>
<br>
+if (LIBCXX_STANDALONE_BUILD AND EXISTS "${LLVM_MAIN_SRC_DIR}/utils/<wbr>llvm-lit")<br>
+  # Make sure the llvm-lit script is generated into the bin directory, and do<br>
+  # it after adding all tests, since the generated script will only work<br>
+  # correctly discovered tests against test locations from the source tree that<br>
+  # have already been discovered.<br>
+  add_subdirectory(${LLVM_MAIN_<wbr>SRC_DIR}/utils/llvm-lit<br>
+                   ${CMAKE_CURRENT_BINARY_DIR}/<wbr>llvm-lit)<br>
+endif()<br>
+<br>
 if (LIBCXX_INCLUDE_DOCS)<br>
   add_subdirectory(docs)<br>
 endif()<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=313643&r1=313642&r2=313643&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/libcxx/trunk/cmake/<wbr>Modules/HandleOutOfTreeLLVM.<wbr>cmake?rev=313643&r1=313642&r2=<wbr>313643&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- libcxx/trunk/cmake/Modules/<wbr>HandleOutOfTreeLLVM.cmake (original)<br>
+++ libcxx/trunk/cmake/Modules/<wbr>HandleOutOfTreeLLVM.cmake Tue Sep 19 10:19:10 2017<br>
@@ -106,6 +106,11 @@ macro(configure_out_of_tree_<wbr>llvm)<br>
     set(LLVM_ENABLE_SPHINX OFF)<br>
   endif()<br>
<br>
+  # In a standalone build, we don't have llvm to automatically generate the<br>
+  # llvm-lit script for us.  So we need to provide an explicit directory that<br>
+  # the configurator should write the script into.<br>
+  set(LLVM_LIT_OUTPUT_DIR "${libcxx_BINARY_DIR}/bin")<br>
+<br>
   # Required LIT Configuration ------------------------------<wbr>------------------<br>
   # Define the default arguments to use with 'lit', and an option for the user<br>
   # to override.<br>
<br>
Modified: libcxx/trunk/test/CMakeLists.<wbr>txt<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/CMakeLists.txt?rev=313643&r1=313642&r2=313643&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/libcxx/trunk/test/<wbr>CMakeLists.txt?rev=313643&r1=<wbr>313642&r2=313643&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- libcxx/trunk/test/CMakeLists.<wbr>txt (original)<br>
+++ libcxx/trunk/test/CMakeLists.<wbr>txt Tue Sep 19 10:19:10 2017<br>
@@ -49,10 +49,9 @@ set(LIBCXX_EXECUTOR "None" CACHE STRING<br>
<br>
 set(AUTO_GEN_COMMENT "## Autogenerated by libcxx configuration.\n# Do not edit!")<br>
<br>
-configure_file(<br>
+configure_lit_site_cfg(<br>
   ${CMAKE_CURRENT_SOURCE_DIR}/<a href="http://lit.site.cfg.in" rel="noreferrer" target="_blank">li<wbr>t.site.cfg.in</a><br>
-  ${CMAKE_CURRENT_BINARY_DIR}/<wbr>lit.site.cfg<br>
-  @ONLY)<br>
+  ${CMAKE_CURRENT_BINARY_DIR}/<wbr>lit.site.cfg)<br>
<br>
 set(LIBCXX_TEST_DEPS "")<br>
<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>