From 622b7b3aef7570c89b9d31e229686cede441d8d4 Mon Sep 17 00:00:00 2001 From: Richard Li Date: Thu, 17 Aug 2023 21:55:25 -0700 Subject: [PATCH] try find_package Differential Revision: D48459007 fbshipit-source-id: 8471743b63c794e46814da0bd42243d73bfec097 --- .github/build.sh | 2 +- lib/LLVMIRCodeGen/CMakeLists.txt | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/build.sh b/.github/build.sh index c3a0df2682..30a29a3f96 100755 --- a/.github/build.sh +++ b/.github/build.sh @@ -180,7 +180,7 @@ else fi if [ "${CIRCLE_JOB}" != "COVERAGE" ] && [ "${CIRCLE_JOB}" != "CHECK_CLANG_AND_PEP8_FORMAT" ] && [ "${CIRCLE_JOB}" != "PYTORCH" ]; then - # sleep 2h + sleep 2h cmake -GNinja ${CMAKE_ARGS[*]} ../ ninja fi diff --git a/lib/LLVMIRCodeGen/CMakeLists.txt b/lib/LLVMIRCodeGen/CMakeLists.txt index c7d5a5a023..1857187256 100644 --- a/lib/LLVMIRCodeGen/CMakeLists.txt +++ b/lib/LLVMIRCodeGen/CMakeLists.txt @@ -12,6 +12,11 @@ add_library(LLVMIRCodeGen LLVMIRGen.cpp LLVMBackend.cpp) +find_package(LLVM REQUIRED CONFIG) + +include_directories(${LLVM_INCLUDE_DIRS}) +add_definitions(${LLVM_DEFINITIONS}) + llvm_map_components_to_libnames(LLVM_TARGET_LIBRARIES ${LLVM_TARGETS_TO_BUILD}) target_link_libraries(LLVMIRCodeGen PUBLIC