<div dir="ltr">Hi Reid,<br><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature">On Mon, Aug 10, 2015 at 5:33 PM, Reid Kleckner via llvm-commits <span dir="ltr"><<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>></span> wrote:<br></div></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: rnk<br>
Date: Mon Aug 10 19:33:07 2015<br>
New Revision: 244549<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=244549&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=244549&view=rev</a><br>
Log:<br>
[cmake] Hoist check for LLD sources up into root CMakeLists.txt<br>
<br>
We will use this for ASan on Windows soon. When the ELF port of LLD<br>
matures, we can add other sanitizer integration tests to make sure they<br>
work with LLD.<br>
<br>
Modified:<br>
    compiler-rt/trunk/CMakeLists.txt<br>
    compiler-rt/trunk/test/cfi/CMakeLists.txt<br>
    compiler-rt/trunk/test/lit.common.cfg<br>
    compiler-rt/trunk/test/<a href="http://lit.common.configured.in" rel="noreferrer" target="_blank">lit.common.configured.in</a><br>
<br>
Modified: compiler-rt/trunk/CMakeLists.txt<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/CMakeLists.txt?rev=244549&r1=244548&r2=244549&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/CMakeLists.txt?rev=244549&r1=244548&r2=244549&view=diff</a><br>
==============================================================================<br>
--- compiler-rt/trunk/CMakeLists.txt (original)<br>
+++ compiler-rt/trunk/CMakeLists.txt Mon Aug 10 19:33:07 2015<br>
@@ -355,6 +355,14 @@ else()<br>
   set(COMPILER_RT_HAS_LIBCXX_SOURCES FALSE)<br>
 endif()<br>
<br>
+set(COMPILER_RT_LLD_PATH ${LLVM_MAIN_SRC_DIR}/tools/lld)<br></blockquote><div>Please make it work for the external lld source case.</div><div>At the very least, the LLVM_EXTERNAL_LLD_SOURCE_DIR variable should be used, if it's there and we don't have lld in the main source dir.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+if(EXISTS ${COMPILER_RT_LLD_PATH}/)<br>
+  set(COMPILER_RT_HAS_LLD_SOURCES TRUE)<br>
+else()<br>
+  set(COMPILER_RT_HAS_LLD_SOURCES FALSE)<br>
+endif()<br>
+pythonize_bool(COMPILER_RT_HAS_LLD_SOURCES)<br>
+<br>
 add_subdirectory(lib)<br>
<br>
 if(COMPILER_RT_INCLUDE_TESTS)<br>
<br>
Modified: compiler-rt/trunk/test/cfi/CMakeLists.txt<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/cfi/CMakeLists.txt?rev=244549&r1=244548&r2=244549&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/cfi/CMakeLists.txt?rev=244549&r1=244548&r2=244549&view=diff</a><br>
==============================================================================<br>
--- compiler-rt/trunk/test/cfi/CMakeLists.txt (original)<br>
+++ compiler-rt/trunk/test/cfi/CMakeLists.txt Mon Aug 10 19:33:07 2015<br>
@@ -19,7 +19,7 @@ if(NOT COMPILER_RT_STANDALONE_BUILD)<br>
       LTO<br>
     )<br>
   endif()<br>
-  if(WIN32 AND EXISTS ${CMAKE_SOURCE_DIR}/tools/lld)<br>
+  if(WIN32 AND COMPILER_RT_HAS_LLD_SOURCES)<br>
     list(APPEND CFI_TEST_DEPS<br>
       lld<br>
     )<br>
<br>
Modified: compiler-rt/trunk/test/lit.common.cfg<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/lit.common.cfg?rev=244549&r1=244548&r2=244549&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/lit.common.cfg?rev=244549&r1=244548&r2=244549&view=diff</a><br>
==============================================================================<br>
--- compiler-rt/trunk/test/lit.common.cfg (original)<br>
+++ compiler-rt/trunk/test/lit.common.cfg Mon Aug 10 19:33:07 2015<br>
@@ -106,6 +106,10 @@ sanitizer_can_use_cxxabi = getattr(confi<br>
 if sanitizer_can_use_cxxabi:<br>
   config.available_features.add('cxxabi')<br>
<br>
+# Test lld if it is available.<br>
+if config.has_lld:<br>
+  config.available_features.add('lld')<br>
+<br>
 lit.util.usePlatformSdkOnDarwin(config, lit_config)<br>
<br>
 def is_darwin_lto_supported():<br>
<br>
Modified: compiler-rt/trunk/test/<a href="http://lit.common.configured.in" rel="noreferrer" target="_blank">lit.common.configured.in</a><br>
URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/lit.common.configured.in?rev=244549&r1=244548&r2=244549&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/lit.common.configured.in?rev=244549&r1=244548&r2=244549&view=diff</a><br>
==============================================================================<br>
--- compiler-rt/trunk/test/<a href="http://lit.common.configured.in" rel="noreferrer" target="_blank">lit.common.configured.in</a> (original)<br>
+++ compiler-rt/trunk/test/<a href="http://lit.common.configured.in" rel="noreferrer" target="_blank">lit.common.configured.in</a> Mon Aug 10 19:33:07 2015<br>
@@ -28,6 +28,7 @@ set_default("compiler_rt_debug", @COMPIL<br>
 set_default("compiler_rt_libdir", "@COMPILER_RT_LIBRARY_OUTPUT_DIR@")<br>
 set_default("emulator", "@COMPILER_RT_EMULATOR@")<br>
 set_default("sanitizer_can_use_cxxabi", @SANITIZER_CAN_USE_CXXABI_PYBOOL@)<br>
+set_default("has_lld", @COMPILER_RT_HAS_LLD_SOURCES_PYBOOL@)<br>
<br>
 # LLVM tools dir can be passed in lit parameters, so try to<br>
 # apply substitution.<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
</blockquote></div><br></div></div>