[llvm] [Offload] Explicitly create directories that contain tablegen output (PR #142817)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 4 10:13:31 PDT 2025
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-offload
Author: Callum Fare (callumfare)
<details>
<summary>Changes</summary>
This isn't required when building with Ninja, but with the Makefile generator these directories don't get implicitly created.
---
Full diff: https://github.com/llvm/llvm-project/pull/142817.diff
2 Files Affected:
- (modified) offload/liboffload/API/CMakeLists.txt (+1)
- (modified) offload/plugins-nextgen/common/CMakeLists.txt (+1)
``````````diff
diff --git a/offload/liboffload/API/CMakeLists.txt b/offload/liboffload/API/CMakeLists.txt
index 216710faa84f6..e4baa4772a1ef 100644
--- a/offload/liboffload/API/CMakeLists.txt
+++ b/offload/liboffload/API/CMakeLists.txt
@@ -7,6 +7,7 @@
set(LLVM_TARGET_DEFINITIONS ${CMAKE_CURRENT_SOURCE_DIR}/OffloadAPI.td)
set(files_to_copy "")
+file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/generated)
macro(offload_tablegen file)
tablegen(OFFLOAD generated/${file}.gen ${ARGN})
diff --git a/offload/plugins-nextgen/common/CMakeLists.txt b/offload/plugins-nextgen/common/CMakeLists.txt
index a28151d46f432..8c171df923823 100644
--- a/offload/plugins-nextgen/common/CMakeLists.txt
+++ b/offload/plugins-nextgen/common/CMakeLists.txt
@@ -1,6 +1,7 @@
# The error codes in this header are shared with liboffload, so need to be
# generated from the same source.
include(TableGen)
+file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/include)
set(LLVM_TARGET_DEFINITIONS ${CMAKE_CURRENT_SOURCE_DIR}/../../liboffload/API/OffloadAPI.td)
tablegen(OFFLOAD include/OffloadErrcodes.inc -gen-errcodes -I ${CMAKE_CURRENT_SOURCE_DIR}/../../liboffload/API)
add_public_tablegen_target(PluginErrcodes)
``````````
</details>
https://github.com/llvm/llvm-project/pull/142817
More information about the llvm-commits
mailing list