<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="">Hi Takumi,<div class=""><br class=""></div><div class="">What is the issue you’re seeing? Do you have a reproduction case?</div><div class=""><br class=""></div><div class="">This change is trying to solve the case where there is no target to generate the tablegen executable. This happens when you are cross-compiling or when you are using LLVM_OPTIMIZED_TABLEGEN=On.</div><div class=""><br class=""></div><div class="">-Chris</div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Nov 1, 2016, at 11:20 AM, NAKAMURA Takumi <<a href="mailto:geek4civic@gmail.com" class="">geek4civic@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">Chris, excuse me to respond an older commit.<br class=""><br class=""><div class="gmail_quote"><div dir="ltr" class="">On Sat, Apr 25, 2015 at 2:17 AM Chris Bieneman <<a href="mailto:beanz@apple.com" class="">beanz@apple.com</a>> wrote:<br class=""></div><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;">Author: cbieneman<br class="gmail_msg">Date: Fri Apr 24 12:09:20 2015<br class="gmail_msg">New Revision: 235732<br class="gmail_msg"><br class="gmail_msg">URL:<span class="Apple-converted-space"> </span><a href="http://llvm.org/viewvc/llvm-project?rev=235732&view=rev" rel="noreferrer" class="gmail_msg" target="_blank">http://llvm.org/viewvc/llvm-project?rev=235732&view=rev</a><br class="gmail_msg">Log:<br class="gmail_msg">[CMake] Fix for PR 23328: LLVM_OPTIMIZED_TABLEGEN broken<br class="gmail_msg"><br class="gmail_msg">In CMake dependencies can be filenames or targets, and targets can't be filenames. The Ninja generator handles filename dependencies because it generates targets for every output file from a command. For example:<br class="gmail_msg"><br class="gmail_msg">add_custom_command(OUTPUT foo.txt COMMAND touch foo.txt)<br class="gmail_msg"><br class="gmail_msg">With the Ninja generator this generates a target foo.txt, but with the Makefile generator it doesn't. This is probably because Ninja explicitly requires these hard dependency ties, and Make just behaves oddly in general.<br class="gmail_msg"><br class="gmail_msg">To fix this we need to make the tablegen actions depend on a target rather than a filename.<br class="gmail_msg"><br class="gmail_msg">Modified:<br class="gmail_msg">   <span class="Apple-converted-space"> </span>llvm/trunk/cmake/modules/TableGen.cmake<br class="gmail_msg"><br class="gmail_msg">Modified: llvm/trunk/cmake/modules/TableGen.cmake<br class="gmail_msg">URL:<span class="Apple-converted-space"> </span><a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/modules/TableGen.cmake?rev=235732&r1=235731&r2=235732&view=diff" rel="noreferrer" class="gmail_msg" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/modules/TableGen.cmake?rev=235732&r1=235731&r2=235732&view=diff</a><br class="gmail_msg">==============================================================================<br class="gmail_msg">--- llvm/trunk/cmake/modules/TableGen.cmake (original)<br class="gmail_msg">+++ llvm/trunk/cmake/modules/TableGen.cmake Fri Apr 24 12:09:20 2015<br class="gmail_msg">@@ -32,7 +32,7 @@ function(tablegen project ofn)<br class="gmail_msg">     # The file in LLVM_TARGET_DEFINITIONS may be not in the current<br class="gmail_msg">     # directory and local_tds may not contain it, so we must<br class="gmail_msg">     # explicitly list it here:<br class="gmail_msg">-    DEPENDS ${${project}_TABLEGEN_EXE} ${local_tds} ${global_tds}<br class="gmail_msg">+    DEPENDS ${${project}_TABLEGEN_TARGET} ${local_tds} ${global_tds}<br class="gmail_msg"></blockquote><div class=""><br class=""></div><div class="">I think it'd be wrong. Order-only dependency is generated in trunk.</div><div class=""><br class=""></div><div class="">  build include/llvm/IR/Intrinsics.gen.tmp: CUSTOM_COMMAND<span class="Apple-converted-space"> </span><a href="http://foo.td/" class="">foo.td</a><span class="Apple-converted-space"> </span>...</div><div class="">  || utils/TableGen/LLVM-tablegen-host<br class=""></div><div class=""><br class=""></div><div class="">I think it should be right with<span class="inbox-inbox-Apple-converted-space"> </span>${${project}_TABLEGEN_EXE}. Files (or executable targets) may be described here.</div><div class=""><br class=""></div><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;">     ${LLVM_TARGET_DEFINITIONS_ABSOLUTE}<br class="gmail_msg">     COMMENT "Building ${ofn}..."<br class="gmail_msg">     )<br class="gmail_msg">@@ -90,6 +90,7 @@ macro(add_tablegen target project)<br class="gmail_msg"><br class="gmail_msg">   # Effective tblgen executable to be used:<br class="gmail_msg">   set(${project}_TABLEGEN_EXE ${${project}_TABLEGEN} PARENT_SCOPE)<br class="gmail_msg">+  set(${project}_TABLEGEN_TARGET ${${project}_TABLEGEN} PARENT_SCOPE)<br class="gmail_msg"><br class="gmail_msg">   if(LLVM_USE_HOST_TOOLS)<br class="gmail_msg">     if( ${${project}_TABLEGEN} STREQUAL "${target}" )<br class="gmail_msg">@@ -101,8 +102,8 @@ macro(add_tablegen target project)<br class="gmail_msg">         DEPENDS CONFIGURE_LLVM_NATIVE ${target}<br class="gmail_msg">         WORKING_DIRECTORY ${LLVM_NATIVE_BUILD}<br class="gmail_msg">         COMMENT "Building native TableGen...")<br class="gmail_msg">-      add_custom_target(${project}NativeTableGen DEPENDS ${${project}_TABLEGEN_EXE})<br class="gmail_msg">-      add_dependencies(${project}NativeTableGen CONFIGURE_LLVM_NATIVE)<br class="gmail_msg">+      add_custom_target(${project}-tablegen-host DEPENDS ${${project}_TABLEGEN_EXE})<br class="gmail_msg">+      set(${project}_TABLEGEN_TARGET ${project}-tablegen-host PARENT_SCOPE)<br class="gmail_msg">     endif()<br class="gmail_msg">   endif()<br class="gmail_msg"><br class="gmail_msg"><br class="gmail_msg"><br class="gmail_msg">_______________________________________________<br class="gmail_msg">llvm-commits mailing list<br class="gmail_msg"><a href="mailto:llvm-commits@cs.uiuc.edu" class="gmail_msg" target="_blank">llvm-commits@cs.uiuc.edu</a><br class="gmail_msg"><a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" rel="noreferrer" class="gmail_msg" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a></blockquote></div></div></div></blockquote></div><br class=""></div></body></html>