<div dir="ltr">Looks like subsequent calls to cmake_minimum_required(VERSION 3.4.3) resets policies.  You can test this by duplicating the call in llvm/CMakeLists.txt after setting a policy.<div><br></div><div>Perhaps clang, et al, including libcxx, etc., should do something like this:</div><div><br></div><div>if( CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR )</div><div>  cmake_minimum_required(VERSION 3.4.3)</div><div>endif()</div><div><br></div><div>Clang already does this check, so moving the call to cmake_minimum_required inside the check would help.</div><div><br></div><div>Also, it might be a good idea to remove all the obsolete cmake_policy calls that set the policy to NEW, since that's the default once the minumum version has been set.  Perhaps we could even put all of this in a macro that all projects could call without the need to duplicate the same logic.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Aug 4, 2017 at 3:04 AM, Martell Malone via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@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"><div dir="ltr">Hey <span style="font-size:12.8px">Takumi ,<br><br></span>Seen as this is related to 3.9. What are your thoughts on how to update the variables to solve this<br>Will we just add the policy to cmake or change RPATH on macos behave differently?<br><br>```<br><div>CMake Warning (dev):</div><div>  Policy CMP0068 is not set: RPATH settings on macOS do not affect</div><div>  install_name.  Run "cmake --help-policy CMP0068" for policy details.  Use</div><div>  the cmake_policy command to set the policy and suppress this warning.</div><div>  For compatibility with older versions of CMake, the install_name fields for</div><div>  the following targets are still affected by RPATH settings:</div><div>   LTO</div><div>   libclang</div><div>This warning is for project developers.  Use -Wno-dev to suppress it.<br>```<br><br>This is from an MacOS host building clang with cmake 3.9 and ninja</div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jul 21, 2017 at 12:07 AM, NAKAMURA Takumi via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@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"><div dir="ltr"><br><br><div class="gmail_quote"><span><div dir="ltr">On Fri, Jul 21, 2017 at 1:16 AM Reid Kleckner <<a href="mailto:rnk@google.com" target="_blank">rnk@google.com</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">This is great news! Do we know who contributed the changes to cut the extra library dependencies?<div><br></div><div>Do you think we should remove ENABLE_OBJLIB to simplify our CMake files in the near future? It seems to me that anyone who cares about highly parallel build throughput can upgrade CMake to get the good behavior. It's probably easier and less error-prone than maintaining a special build configuration.</div></div></blockquote><div><br></div></span><div>At the moment, this facility (loose deps) is specific to Ninja generator.</div><div>There are a couple of users of ENABLE_OBJLIB.</div><div>- Tablegen (except for ninja).</div><div>- LIBCLANG_BUILD_STATIC. It doesn't use LLVM_ENABLE_OBJLIB, but uses it internally.</div><div><br></div><div>Thanks,</div><div>Takumi</div><span><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="gmail_extra">On Thu, Jul 20, 2017 at 8:31 AM, NAKAMURA Takumi via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>></span> wrote:<br></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"><div dir="ltr"><div>This is useful for developer who uses multicore builder.</div><div><a href="https://cmake.org/cmake/help/v3.9/release/3.9.html#other-changes" target="_blank">https://cmake.org/cmake/help/v<wbr>3.9/release/3.9.html#other-cha<wbr>nges</a></div><div><br></div><div><ul class="m_-4623022613446824396m_6761287612674915590m_-6917408570697063668m_5748386785943613430inbox-inbox-simple" style="color:rgb(68,68,68);font-size:24px"><li style="text-align:justify;line-height:31.2px">The <span class="m_-4623022613446824396m_6761287612674915590m_-6917408570697063668m_5748386785943613430inbox-inbox-target" id="m_-4623022613446824396m_6761287612674915590m_-6917408570697063668m_5748386785943613430inbox-inbox-index-1-generator:Ninja"></span><a class="m_-4623022613446824396m_6761287612674915590m_-6917408570697063668m_5748386785943613430inbox-inbox-reference m_-4623022613446824396m_6761287612674915590m_-6917408570697063668m_5748386785943613430inbox-inbox-internal" href="https://cmake.org/cmake/help/v3.9/generator/Ninja.html#generator:Ninja" title="Ninja" style="color:rgb(43,99,168);text-decoration-line:none" target="_blank"><code class="m_-4623022613446824396m_6761287612674915590m_-6917408570697063668m_5748386785943613430inbox-inbox-xref m_-4623022613446824396m_6761287612674915590m_-6917408570697063668m_5748386785943613430inbox-inbox-cmake m_-4623022613446824396m_6761287612674915590m_-6917408570697063668m_5748386785943613430inbox-inbox-cmake-generator m_-4623022613446824396m_6761287612674915590m_-6917408570697063668m_5748386785943613430inbox-inbox-docutils m_-4623022613446824396m_6761287612674915590m_-6917408570697063668m_5748386785943613430inbox-inbox-literal" style="background-color:transparent;padding:0px 1px;font-size:0.95em;font-weight:bold"><span class="m_-4623022613446824396m_6761287612674915590m_-6917408570697063668m_5748386785943613430inbox-inbox-pre">Ninja</span></code></a> generator has loosened the dependencies of object compilation. Object compilation now depends only on custom targets and custom commands associated with libraries on which the object’s target depends and no longer depends on the libraries themselves. Source files in dependent targets may now compile without waiting for their targets’ dependencies to link.</li></ul>With BUILD_SHARED_LIBS, compiling units don't wait for preceding shared libs.</div><div>See also; <a href="http://bb.pgr.jp/builders/i686-mingw32-RA-on-linux" target="_blank">http://bb.pgr.jp/builder<wbr>s/i686-mingw32-RA-on-linux</a></div><div>Regardless of BUILD_SHARED_LIBS, compile units in add_executable() don't wait for preceding libraries,</div><div>but targets by add_dependencies().</div><div><br></div><div>It doesn't break anything in llvm tree. Assume;</div><div>  add_executable(foo foo.cpp)</div><div>  target_link_libraries(foo LLVMCore) # depends on intrinsics_gen</div><div>Compiling foo.cpp doesn't wait for LLVMCore, but intrinsics_gen.</div><div>Linking foo waits for LLVMCore.</div><div><br></div><div>I have been working for cutting dependencies to increase parallelism.</div><div>For example, I introduced ENABLE_OBJLIB.</div><div>See also, <a href="https://reviews.llvm.org/rL305635" target="_blank">https://reviews.llvm.org<wbr>/rL305635</a></div><div>Ninja with CMake-3.9 doesn't require parallelize with objlib.</div><div><br></div><div>I love ninja-build.</div><div><br></div><div>Thanks,</div><div>Takumi</div></div>
<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">______________________________<wbr>_________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</a><br>
<br></blockquote></div><br></div>
</blockquote></span></div></div>
<br>______________________________<wbr>_________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</a><br>
<br></blockquote></div><br></div>
</div></div><br>______________________________<wbr>_________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</a><br>
<br></blockquote></div><br></div>