diff --git a/enzyme/Enzyme/CMakeLists.txt b/enzyme/Enzyme/CMakeLists.txt index a55be9525be..7d42aa7d874 100644 --- a/enzyme/Enzyme/CMakeLists.txt +++ b/enzyme/Enzyme/CMakeLists.txt @@ -38,8 +38,13 @@ add_public_tablegen_target(BlasTAIncGen) add_public_tablegen_target(BlasDiffUseIncGen) set(LLVM_TARGET_DEFINITIONS Clang/include_utils.td) +# Need to explicitly set included files as dependencies +set(ARG_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/Runtime/MPFR.cpp" CACHE INTERNAL "deps") +# Cmake tablegen adds the current cmake dir to the include path and bazel adds +# the directory that contains the .td file, that's why we need the include here enzyme_tablegen(IncludeUtils.inc -gen-header-strings -I${CMAKE_CURRENT_SOURCE_DIR}/Clang/) add_public_tablegen_target(IncludeUtilsIncGen) +unset(ARG_DEPENDS) include_directories(${CMAKE_CURRENT_BINARY_DIR})