Skip to content

Commit 8e9a505

Browse files
committed
[flang] Fix out-of-tree build with missing acc_gen target
This pacth fix out-of-tree build of Flang after the introduction of acc_gen. Reviewed By: sscalpone Differential Revision: https://reviews.llvm.org/D83835
1 parent 9aa3dca commit 8e9a505

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

llvm/cmake/modules/AddLLVM.cmake

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -891,7 +891,7 @@ endmacro(add_llvm_executable name)
891891
# only an object library is built, and no module is built. This is specific to the Polly use case.
892892
#
893893
# The SUBPROJECT argument contains the LLVM project the plugin belongs
894-
# to. If set, the plugin will link statically by default it if the
894+
# to. If set, the plugin will link statically by default it if the
895895
# project was enabled.
896896
function(add_llvm_pass_plugin name)
897897
cmake_parse_arguments(ARG
@@ -928,6 +928,9 @@ function(add_llvm_pass_plugin name)
928928
if (TARGET omp_gen)
929929
add_dependencies(obj.${name} omp_gen)
930930
endif()
931+
if (TARGET acc_gen)
932+
add_dependencies(obj.${name} acc_gen)
933+
endif()
931934
set_property(GLOBAL APPEND PROPERTY LLVM_STATIC_EXTENSIONS ${name})
932935
elseif(NOT ARG_NO_MODULE)
933936
add_llvm_library(${name} MODULE ${ARG_UNPARSED_ARGUMENTS})

llvm/cmake/modules/LLVMConfig.cmake.in

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,15 +104,18 @@ if(NOT TARGET LLVMSupport)
104104
@llvm_config_include_buildtree_only_exports@
105105
endif()
106106

107-
# By creating intrinsics_gen and omp_gen here, subprojects that depend on LLVM's
108-
# tablegen-generated headers can always depend on this target whether building
109-
# in-tree with LLVM or not.
107+
# By creating intrinsics_gen, omp_gen and acc_gen here, subprojects that depend
108+
# on LLVM's tablegen-generated headers can always depend on this target whether
109+
# building in-tree with LLVM or not.
110110
if(NOT TARGET intrinsics_gen)
111111
add_custom_target(intrinsics_gen)
112112
endif()
113113
if(NOT TARGET omp_gen)
114114
add_custom_target(omp_gen)
115115
endif()
116+
if(NOT TARGET acc_gen)
117+
add_custom_target(acc_gen)
118+
endif()
116119

117120
set_property(GLOBAL PROPERTY LLVM_TARGETS_CONFIGURED On)
118121
include(${LLVM_CMAKE_DIR}/LLVM-Config.cmake)

0 commit comments

Comments
 (0)