From 33bcb3dc790d72845c997940f17fafb35f096b30 Mon Sep 17 00:00:00 2001 From: Roman Lebedev Date: Tue, 6 Dec 2022 03:49:23 +0300 Subject: [PATCH] Revert "[OpenMP] Use `add_llvm_library` to build the target `PluginInterface` in `plugins-nextgen`" Breaks cmake regeneration for me: ``` CMake Error: install(EXPORT "LLVMExports" ...) includes target "omptarget.rtl.cuda.nextgen" which requires target "PluginInterface" that is not in any export set. CMake Error: install(EXPORT "LLVMExports" ...) includes target "omptarget.rtl.x86_64.nextgen" which requires target "PluginInterface" that is not in any export set. ``` This reverts commit 08c4081bd3605e1b01a7ccd6accc9052c8966250. --- .../common/PluginInterface/CMakeLists.txt | 34 ++++++++++------------ 1 file changed, 15 insertions(+), 19 deletions(-) diff --git a/openmp/libomptarget/plugins-nextgen/common/PluginInterface/CMakeLists.txt b/openmp/libomptarget/plugins-nextgen/common/PluginInterface/CMakeLists.txt index 3c22308..60aeff8 100644 --- a/openmp/libomptarget/plugins-nextgen/common/PluginInterface/CMakeLists.txt +++ b/openmp/libomptarget/plugins-nextgen/common/PluginInterface/CMakeLists.txt @@ -11,28 +11,24 @@ ##===----------------------------------------------------------------------===## # Plugin Interface library. -add_llvm_library(PluginInterface PluginInterface.cpp GlobalHandler.cpp - BUILDTREE_ONLY +add_library(PluginInterface OBJECT PluginInterface.cpp GlobalHandler.cpp) - LINK_COMPONENTS - Support +# Define the TARGET_NAME. +add_definitions("-DTARGET_NAME=PluginInterface") - LINK_LIBS PRIVATE - elf_common - MemoryManager -) - -# Define the TARGET_NAME and DEBUG_PREFIX. -target_compile_definitions(PluginInterface PRIVATE - TARGET_NAME="PluginInterface" - DEBUG_PREFIX="PluginInterface" -) - -target_include_directories(PluginInterface - INTERFACE ${CMAKE_CURRENT_SOURCE_DIR} - PRIVATE ${LIBOMPTARGET_INCLUDE_DIR} -) +# Define the DEBUG_PREFIX. +add_definitions(-DDEBUG_PREFIX="PluginInterface") set_target_properties(PluginInterface PROPERTIES POSITION_INDEPENDENT_CODE ON CXX_VISIBILITY_PRESET protected) +llvm_update_compile_flags(PluginInterface) +set(LINK_LLVM_LIBS LLVMSupport) +if (LLVM_LINK_LLVM_DYLIB) + set(LINK_LLVM_LIBS LLVM) +endif() +target_link_libraries(PluginInterface INTERFACE ${LINK_LLVM_LIBS} PRIVATE elf_common MemoryManager) +add_dependencies(PluginInterface ${LINK_LLVM_LIBS}) + +target_include_directories(PluginInterface INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) +target_include_directories(PluginInterface PRIVATE ${LIBOMPTARGET_INCLUDE_DIR}) -- 2.7.4