Assist find_package(LLVMGTest by setting hint dir to LLVM_CMAKE_DIR

This commit is contained in:
Konrad Kleine 2023-01-23 15:13:31 +00:00 committed by Tulio Magno Quites Machado Filho
parent 7ac8248795
commit 0f9040cc95
2 changed files with 4 additions and 3 deletions

View File

@ -1,4 +1,4 @@
From 04ee57212326f872b6f9402eff438220396ca763 Mon Sep 17 00:00:00 2001 From 04b642c646048dd9df652eba05d45beaa13bc895 Mon Sep 17 00:00:00 2001
From: Konrad Kleine <kkleine@redhat.com> From: Konrad Kleine <kkleine@redhat.com>
Date: Mon, 23 Jan 2023 13:14:17 +0000 Date: Mon, 23 Jan 2023 13:14:17 +0000
Subject: [PATCH] Rebased D138472 Subject: [PATCH] Rebased D138472
@ -8,7 +8,7 @@ Subject: [PATCH] Rebased D138472
1 file changed, 10 insertions(+), 13 deletions(-) 1 file changed, 10 insertions(+), 13 deletions(-)
diff --git a/clang/CMakeLists.txt b/clang/CMakeLists.txt diff --git a/clang/CMakeLists.txt b/clang/CMakeLists.txt
index 090cfa352078..69652733e2f2 100644 index 090cfa352078..f87838776c32 100644
--- a/clang/CMakeLists.txt --- a/clang/CMakeLists.txt
+++ b/clang/CMakeLists.txt +++ b/clang/CMakeLists.txt
@@ -118,12 +118,11 @@ if(CLANG_BUILT_STANDALONE) @@ -118,12 +118,11 @@ if(CLANG_BUILT_STANDALONE)
@ -23,7 +23,7 @@ index 090cfa352078..69652733e2f2 100644
- endif() - endif()
+ endif() + endif()
+ +
+ find_package(LLVMGTest) + find_package(LLVMGTest HINTS "${LLVM_CMAKE_DIR}")
+ if (NOT TARGET llvm_gtest) + if (NOT TARGET llvm_gtest)
+ message(FATAL_ERROR "llvm-gtest not found. Please install llvm-gtest or disable tests with -DLLVM_INCLUDE_TESTS=OFF") + message(FATAL_ERROR "llvm-gtest not found. Please install llvm-gtest or disable tests with -DLLVM_INCLUDE_TESTS=OFF")
endif() endif()

View File

@ -341,6 +341,7 @@ sed -i 's/\@FEDORA_LLVM_LIB_SUFFIX\@//g' test/lit.cfg.py
-DLLVM_EXTERNAL_LIT=%{_bindir}/lit \ -DLLVM_EXTERNAL_LIT=%{_bindir}/lit \
-DLLVM_LIT_ARGS="-vv" \ -DLLVM_LIT_ARGS="-vv" \
-DLLVM_MAIN_SRC_DIR=%{_datadir}/llvm/src \ -DLLVM_MAIN_SRC_DIR=%{_datadir}/llvm/src \
-DLLVM_CMAKE_DIR=/usr/%{_lib}/cmake/llvm \
%if 0%{?__isa_bits} == 64 %if 0%{?__isa_bits} == 64
-DLLVM_LIBDIR_SUFFIX=64 \ -DLLVM_LIBDIR_SUFFIX=64 \
%else %else