[clang] [clang][docs] Pass full path of source TD file to gen_rst_from_td. [NFC] (PR #66497)
via cfe-commits
cfe-commits at lists.llvm.org
Fri Sep 15 04:53:19 PDT 2023
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-clang
<details>
<summary>Changes</summary>
This change is needed to be able to refer to TD files that are not stored in ${CMAKE_CURRENT_SOURCE_DIR}.
--
Full diff: https://github.com/llvm/llvm-project/pull/66497.diff
1 Files Affected:
- (modified) clang/docs/CMakeLists.txt (+6-7)
<pre>
diff --git a/clang/docs/CMakeLists.txt b/clang/docs/CMakeLists.txt
index 4163dd2d90ad5b3..a63823c63428288 100644
--- a/clang/docs/CMakeLists.txt
+++ b/clang/docs/CMakeLists.txt
@@ -91,10 +91,10 @@ endif()
endif()
function (gen_rst_file_from_td output_file td_option source docs_targets)
- if (NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${source}")
- message(FATAL_ERROR "Cannot find source file: ${source} in ${CMAKE_CURRENT_SOURCE_DIR}")
+ if (NOT EXISTS "${source}")
+ message(FATAL_ERROR "Cannot find source file: ${source}")
endif()
- get_filename_component(TABLEGEN_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/${source}" DIRECTORY)
+ get_filename_component(TABLEGEN_INCLUDE_DIR "${source}" DIRECTORY)
list(APPEND LLVM_TABLEGEN_FLAGS "-I${TABLEGEN_INCLUDE_DIR}")
clang_tablegen(${output_file} ${td_option} SOURCE ${source} TARGET "gen-${output_file}")
foreach(target ${docs_targets})
@@ -138,10 +138,9 @@ if (LLVM_ENABLE_SPHINX)
endif()
# Generated files
- gen_rst_file_from_td(AttributeReference.rst -gen-attr-docs ../include/clang/Basic/Attr.td "${docs_targets}")
- gen_rst_file_from_td(DiagnosticsReference.rst -gen-diag-docs ../include/clang/Basic/Diagnostic.td "${docs_targets}")
- gen_rst_file_from_td(ClangCommandLineReference.rst -gen-opt-docs ../include/clang/Driver/ClangOptionDocs.td "${docs_targets}")
-
+ gen_rst_file_from_td(AttributeReference.rst -gen-attr-docs ${CMAKE_CURRENT_SOURCE_DIR}/../include/clang/Basic/Attr.td "${docs_targets}")
+ gen_rst_file_from_td(DiagnosticsReference.rst -gen-diag-docs ${CMAKE_CURRENT_SOURCE_DIR}/../include/clang/Basic/Diagnostic.td "${docs_targets}")
+ gen_rst_file_from_td(ClangCommandLineReference.rst -gen-opt-docs ${CMAKE_CURRENT_SOURCE_DIR}/../include/clang/Driver/ClangOptionDocs.td "${docs_targets}")
foreach(target ${docs_targets})
add_dependencies(${target} copy-clang-rst-docs)
endforeach()
</pre>
</details>
https://github.com/llvm/llvm-project/pull/66497
More information about the cfe-commits
mailing list