From a3acf6169f07eab4efca61b26702f8093dc5d330 Mon Sep 17 00:00:00 2001 From: Vipul Cariappa Date: Mon, 16 Dec 2024 13:59:28 +0530 Subject: [PATCH] Revert "fix cmake dependencies when building together with clang (#1168)" This reverts commit c1a87d4afc1f227d9e352fbe8ca947e5b13360bb. --- CMakeLists.txt | 8 ++++++++ tools/CMakeLists.txt | 9 --------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 338684756..162944a26 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -286,6 +286,14 @@ if (NOT CLAD_BUILD_STATIC_ONLY AND NOT LLVM_ENABLE_PLUGINS) message(FATAL_ERROR "LLVM_ENABLE_PLUGINS is set to OFF. Please build clad with -DCLAD_BUILD_STATIC_ONLY=ON.") endif() +# Add clad deps if we build together with clang. +if (TARGET intrinsics_gen) + list(APPEND LLVM_COMMON_DEPENDS intrinsics_gen) +endif() +if (TARGET clang-headers) + list(APPEND LLVM_COMMON_DEPENDS clang-headers) +endif() + add_subdirectory(lib) add_subdirectory(tools) diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index 5845b4a5d..ecf61f4ae 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -132,15 +132,6 @@ if (NOT CLAD_BUILD_STATIC_ONLY) target_link_libraries(clad PUBLIC ${_enzyme_link_flags}) add_dependencies(clad LLVMEnzyme) - - # Add clad deps if we build together with clang. - if (TARGET intrinsics_gen) - add_dependencies(clad intrinsics_gen) - endif() - if (TARGET clang-headers) - add_dependencies(clad clang-headers) - endif() - endif(CLAD_ENABLE_ENZYME_BACKEND) endif() set_source_files_properties(ClangPlugin.cpp PROPERTIES COMPILE_DEFINITIONS CLANG_MAJOR_VERSION="${LLVM_VERSION_MAJOR}")