<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Jun 14, 2017, at 1:51 PM, Zachary Turner <<a href="mailto:zturner@google.com" class="">zturner@google.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">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 class=""></div><div>I thought I knew CMake too … until I saw the LLVM CMake scripts :-(</div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class=""><br class=""></div><div class="">To dumb this down, are you saying that I need to:</div><div class=""><br class=""></div><div class="">a) Never list TestingSupport in LLVM_LINK_COMPONENTS</div><div class="">and</div></div></div></blockquote><div><br class=""></div><div>Yup</div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class="">b) instead link it with target_link_libraries()?</div></div></div></blockquote><div><br class=""></div>Yup. This is what we currently do for gtest_main and gtest in add_unittest:</div><div><br class=""></div><div>llvm/cmake/modules/AddLLVM.cmake:1031: target_link_libraries(${test_name} gtest_main gtest ${LLVM_PTHREAD_LIB})</div><div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class=""><br class=""></div><div class="">And that should fix the problem?</div></div></div></blockquote><div><br class=""></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><br class=""></div><blockquote type="cite" class=""><div class=""><br class=""><div class="gmail_quote"><div dir="ltr" class="">On Wed, Jun 14, 2017 at 1:44 PM Juergen Ributzka <<a href="mailto:juergen@ributzka.de" class="">juergen@ributzka.de</a>> wrote:<br class=""></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="">Hi Zack,<div class=""><br class=""></div><div class="">this breaks cmake for me when I try to configure a build with NO targets:</div><div class=""><span title="CMake Error" style="box-sizing:border-box;font-family:monospace;font-size:13px;white-space:pre-wrap;color:white;background-color:red" class="">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" class=""> 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 class=""></div><div class=""><span style="color:rgb(51,51,51);font-family:monospace;font-size:13px;white-space:pre-wrap" class=""><br class=""></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 class=""><br class=""></div><div class="">Doing the same for TestingSupport would fix the issue. </div><div class=""><br class=""></div><div class="">--Juergen</div></div><div class="gmail_extra"><br class=""><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" class=""><<a href="mailto:llvm-commits@lists.llvm.org" target="_blank" class="">llvm-commits@lists.llvm.org</a>></span> wrote:<br class=""></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 class="">
Closed by commit rL305395: [gtest] Create a shared include directory for gtest utilities. (authored by zturner).<br class="">
<br class="">
Changed prior to commit:<br class="">
<a href="https://reviews.llvm.org/D33059?vs=102340&id=102563#toc" rel="noreferrer" target="_blank" class="">https://reviews.llvm.org/D33059?vs=102340&id=102563#toc</a><br class="">
<br class="">
Repository:<br class="">
rL LLVM<br class="">
<br class="">
<a href="https://reviews.llvm.org/D33059" rel="noreferrer" target="_blank" class="">https://reviews.llvm.org/D33059</a><br class="">
<br class="">
Files:<br class="">
llvm/trunk/include/llvm/Testing/Support/Error.h<br class="">
llvm/trunk/include/llvm/Testing/Support/SupportHelpers.h<br class="">
llvm/trunk/lib/CMakeLists.txt<br class="">
llvm/trunk/lib/LLVMBuild.txt<br class="">
llvm/trunk/lib/Testing/CMakeLists.txt<br class="">
llvm/trunk/lib/Testing/LLVMBuild.txt<br class="">
llvm/trunk/lib/Testing/Support/CMakeLists.txt<br class="">
llvm/trunk/lib/Testing/Support/Error.cpp<br class="">
llvm/trunk/lib/Testing/Support/LLVMBuild.txt<br class="">
llvm/trunk/unittests/DebugInfo/CodeView/CMakeLists.txt<br class="">
llvm/trunk/unittests/DebugInfo/CodeView/ErrorChecking.h<br class="">
llvm/trunk/unittests/DebugInfo/CodeView/RandomAccessVisitorTest.cpp<br class="">
llvm/trunk/unittests/DebugInfo/CodeView/TypeIndexDiscoveryTest.cpp<br class="">
llvm/trunk/unittests/DebugInfo/PDB/CMakeLists.txt<br class="">
llvm/trunk/unittests/DebugInfo/PDB/ErrorChecking.h<br class="">
llvm/trunk/unittests/DebugInfo/PDB/HashTableTest.cpp<br class="">
llvm/trunk/unittests/DebugInfo/PDB/MSFBuilderTest.cpp<br class="">
llvm/trunk/unittests/DebugInfo/PDB/MappedBlockStreamTest.cpp<br class="">
llvm/trunk/unittests/DebugInfo/PDB/StringTableBuilderTest.cpp<br class="">
llvm/trunk/unittests/DebugInfo/PDB/TypeServerHandlerTest.cpp<br class="">
llvm/trunk/unittests/Support/BinaryStreamTest.cpp<br class="">
llvm/trunk/unittests/Support/CMakeLists.txt<br class="">
<br class="">
<br class=""></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 class="">
llvm-commits mailing list<br class="">
<a href="mailto:llvm-commits@lists.llvm.org" target="_blank" class="">llvm-commits@lists.llvm.org</a><br class="">
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank" class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br class="">
<br class=""></blockquote></div><br class=""></div>
</blockquote></div>
</div></blockquote></div><br class=""></body></html>