[flang-commits] [flang] 3bba12a - [Flang] Use find_program() to find clang-tblgen

Nikita Popov via flang-commits flang-commits at lists.llvm.org
Wed Aug 10 01:26:44 PDT 2022


Author: Nikita Popov
Date: 2022-08-10T10:26:36+02:00
New Revision: 3bba12a81e242359580fa322cf1a9a0a43b461e6

URL: https://github.com/llvm/llvm-project/commit/3bba12a81e242359580fa322cf1a9a0a43b461e6
DIFF: https://github.com/llvm/llvm-project/commit/3bba12a81e242359580fa322cf1a9a0a43b461e6.diff

LOG: [Flang] Use find_program() to find clang-tblgen

Use find_program() to find the clang-tblgen executable. The current
code ends up using docs/clang-tblgen for me...

This is the same way that mlir-tblgen is obtained in:
https://github.com/llvm/llvm-project/blob/27241435515554bc21105713c9d34cf886c5bced/flang/CMakeLists.txt#L95-L96.

Differential Revision: https://reviews.llvm.org/D131475

Added: 
    

Modified: 
    flang/docs/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/flang/docs/CMakeLists.txt b/flang/docs/CMakeLists.txt
index 770343cd29b80..3414b8e3acc46 100644
--- a/flang/docs/CMakeLists.txt
+++ b/flang/docs/CMakeLists.txt
@@ -126,7 +126,7 @@ if (LLVM_ENABLE_SPHINX)
         ARGS ${CMAKE_CURRENT_BINARY_DIR}/Source/FIR/CreateFIRLangRef.py)
 
       # CLANG_TABLEGEN_EXE variable needs to be set for clang_tablegen to run without error
-      set(CLANG_TABLEGEN_EXE clang-tblgen)
+      find_program(CLANG_TABLEGEN_EXE "clang-tblgen" ${LLVM_TOOLS_BINARY_DIR} NO_DEFAULT_PATH)
       gen_rst_file_from_td(FlangCommandLineReference.rst -gen-opt-docs FlangOptionsDocs.td docs-flang-html)
     endif()
     if (${SPHINX_OUTPUT_MAN})


        


More information about the flang-commits mailing list