<div dir="ltr">Ok, I'll get that patch upstreamed shortly.  Thanks for the suggested fix!</div><br><div class="gmail_quote"><div dir="ltr">On Wed, Jun 14, 2017 at 2:02 PM Juergen Ributzka <<a href="mailto:juergen@ributzka.de">juergen@ributzka.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div><blockquote type="cite"><div>On Jun 14, 2017, at 1:51 PM, Zachary Turner <<a href="mailto:zturner@google.com" target="_blank">zturner@google.com</a>> wrote:</div><br class="m_-5778894418476671140Apple-interchange-newline"><div><div dir="ltr">Hopefully you’ll forgive my ignorance, as I only pretend to know CMake, but when it gets more involved I need some additional assistance :)</div></div></blockquote><div><br></div></div></div><div style="word-wrap:break-word"><div><div>I thought I knew CMake too … until I saw the LLVM CMake scripts :-(</div></div></div><div style="word-wrap:break-word"><div><br><blockquote type="cite"><div><div dir="ltr"><div><br></div><div>To dumb this down, are you saying that I need to:</div><div><br></div><div>a) Never list TestingSupport in LLVM_LINK_COMPONENTS</div><div>and</div></div></div></blockquote><div><br></div></div></div><div style="word-wrap:break-word"><div><div>Yup</div></div></div><div style="word-wrap:break-word"><div><br><blockquote type="cite"><div><div dir="ltr"><div>b) instead link it with target_link_libraries()?</div></div></div></blockquote><div><br></div></div></div><div style="word-wrap:break-word"><div>Yup. This is what we currently do for gtest_main and gtest in add_unittest:</div><div><br></div><div>llvm/cmake/modules/AddLLVM.cmake:1031: target_link_libraries(${test_name} gtest_main gtest ${LLVM_PTHREAD_LIB})</div><div></div></div><div style="word-wrap:break-word"><div><br><blockquote type="cite"><div><div dir="ltr"><div><br></div><div>And that should fix the problem?</div></div></div></blockquote><div><br></div></div></div><div style="word-wrap:break-word"><div><div>Yes, I tired it and it works for my configuration. It seems a little hacky, but that is how gtest is handled too.</div></div></div><div style="word-wrap:break-word"><div><div><br></div><blockquote type="cite"><div><br><div class="gmail_quote"><div dir="ltr">On Wed, Jun 14, 2017 at 1:44 PM Juergen Ributzka <<a href="mailto:juergen@ributzka.de" target="_blank">juergen@ributzka.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Zack,<div><br></div><div>this breaks cmake for me when I try to configure a build with NO targets:</div><div><span title="CMake Error" style="box-sizing:border-box;font-family:monospace;font-size:13px;white-space:pre-wrap;color:white;background-color:red">CMake Error at cmake/modules/LLVM-Config.cmake:31 (list):
</span><span style="color:rgb(51,51,51);font-family:monospace;font-size:13px;white-space:pre-wrap">  list sub-command REMOVE_ITEM requires two or more arguments.
Call Stack (most recent call first):
  cmake/modules/LLVM-Config.cmake:256 (is_llvm_target_library)
  cmake/modules/LLVM-Config.cmake:100 (llvm_map_components_to_libnames)
  cmake/modules/LLVM-Config.cmake:93 (explicit_llvm_config)
  cmake/modules/AddLLVM.cmake:714 (llvm_config)
  cmake/modules/AddLLVM.cmake:1025 (add_llvm_executable)
  unittests/CMakeLists.txt:5 (add_unittest)
  unittests/DebugInfo/CodeView/CMakeLists.txt:11 (add_llvm_unittest)</span><br></div><div><span style="color:rgb(51,51,51);font-family:monospace;font-size:13px;white-space:pre-wrap"><br></span></div>TestingSupport is configured with BUILDTREE_ONLY. This prevents it from being added to LLVM_LIBS. This seems intentional and mirrors what gtest_main is doing. The problem is that once you add TestingSupport as a link dependency our current cmake logic fails. It works for test_main, because it is never listed in LLVM_LINK_COMPONENTS and always added as part of add_unittest.<div><br></div><div>Doing the same for TestingSupport would fix the issue. </div><div><br></div><div>--Juergen</div></div><div class="gmail_extra"><br><div class="gmail_quote"></div></div><div class="gmail_extra"><div class="gmail_quote">On Wed, Jun 14, 2017 at 9:42 AM, Zachary Turner via Phabricator 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_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">This revision was automatically updated to reflect the committed changes.<br>
Closed by commit rL305395: [gtest] Create a shared include directory for gtest utilities. (authored by zturner).<br>
<br>
Changed prior to commit:<br>
  <a href="https://reviews.llvm.org/D33059?vs=102340&id=102563#toc" rel="noreferrer" target="_blank">https://reviews.llvm.org/D33059?vs=102340&id=102563#toc</a><br>
<br>
Repository:<br>
  rL LLVM<br>
<br>
<a href="https://reviews.llvm.org/D33059" rel="noreferrer" target="_blank">https://reviews.llvm.org/D33059</a><br>
<br>
Files:<br>
  llvm/trunk/include/llvm/Testing/Support/Error.h<br>
  llvm/trunk/include/llvm/Testing/Support/SupportHelpers.h<br>
  llvm/trunk/lib/CMakeLists.txt<br>
  llvm/trunk/lib/LLVMBuild.txt<br>
  llvm/trunk/lib/Testing/CMakeLists.txt<br>
  llvm/trunk/lib/Testing/LLVMBuild.txt<br>
  llvm/trunk/lib/Testing/Support/CMakeLists.txt<br>
  llvm/trunk/lib/Testing/Support/Error.cpp<br>
  llvm/trunk/lib/Testing/Support/LLVMBuild.txt<br>
  llvm/trunk/unittests/DebugInfo/CodeView/CMakeLists.txt<br>
  llvm/trunk/unittests/DebugInfo/CodeView/ErrorChecking.h<br>
  llvm/trunk/unittests/DebugInfo/CodeView/RandomAccessVisitorTest.cpp<br>
  llvm/trunk/unittests/DebugInfo/CodeView/TypeIndexDiscoveryTest.cpp<br>
  llvm/trunk/unittests/DebugInfo/PDB/CMakeLists.txt<br>
  llvm/trunk/unittests/DebugInfo/PDB/ErrorChecking.h<br>
  llvm/trunk/unittests/DebugInfo/PDB/HashTableTest.cpp<br>
  llvm/trunk/unittests/DebugInfo/PDB/MSFBuilderTest.cpp<br>
  llvm/trunk/unittests/DebugInfo/PDB/MappedBlockStreamTest.cpp<br>
  llvm/trunk/unittests/DebugInfo/PDB/StringTableBuilderTest.cpp<br>
  llvm/trunk/unittests/DebugInfo/PDB/TypeServerHandlerTest.cpp<br>
  llvm/trunk/unittests/Support/BinaryStreamTest.cpp<br>
  llvm/trunk/unittests/Support/CMakeLists.txt<br>
<br>
<br></blockquote></div></div><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">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>
<br></blockquote></div><br></div>
</blockquote></div>
</div></blockquote></div></div></blockquote></div>