[PATCH] CMake: use llvm-config to find llvm-tblgen

Hans Wennborg hans at chromium.org
Fri Aug 23 08:56:09 PDT 2013


  > Looks good with one variable name fix.

  Thanks! Will land once http://llvm-reviews.chandlerc.com/D1481 is in, so we actually have llvm-config on Windows :)


================
Comment at: CMakeLists.txt:51
@@ -48,7 +50,3 @@
 
-  if( EXISTS "${CLANG_PATH_TO_LLVM_BUILD}/bin/llvm-tblgen${CMAKE_EXECUTABLE_SUFFIX}" )
-    set(LLVM_TABLEGEN_EXE "${PATH_TO_LLVM_BUILD}/bin/llvm-tblgen${CMAKE_EXECUTABLE_SUFFIX}")
-  else()
-    # FIXME: This is an utter hack.
-    set(LLVM_TABLEGEN_EXE "${PATH_TO_LLVM_BUILD}/bin/Debug/llvm-tblgen${CMAKE_EXECUTABLE_SUFFIX}")
-  endif()
+  exec_program("${PATH_TO_LLVM_CONFIG} --obj-root" OUTPUT_VARIABLE LLVM_TABLEGEN_EXE)
+  set(LLVM_TABLEGEN_EXE "${LLVM_TABLEGEN_EXE}/bin/llvm-tblgen${CMAKE_EXECUTABLE_SUFFIX}")
----------------
Chandler Carruth wrote:
> The output variable name doesn't make a lot of sense to me here... Why not LLVM_OBJ_ROOT or however it's spelled in this cmake area?
Sure, cmake calls it LLVM_BINARY_DIR, so I'll change to that.


http://llvm-reviews.chandlerc.com/D1483



More information about the cfe-commits mailing list