From 99d251b29df6f701ab7cf45d8af33ac46304e4a3 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Wed, 16 Oct 2024 20:09:56 +0200 Subject: [PATCH] Correct pkg-config include path when cross-compiling Prior to this commit, the include path for some libraries found through pkg-config when cross compiling is not correct: $ grep include CMakeCache.txt blas_INCLUDEDIR:INTERNAL=/usr/include/x86_64-linux-gnu ... This is because we did not tell pkg-config to search in the right path. Since for cross-compilation, we install packages in parallel in the system, override the primary directory where the .pc files located, in the cross-compilation toolchain file for cmake. Closes: #746 --- cmake_targets/cross-arm.cmake | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cmake_targets/cross-arm.cmake b/cmake_targets/cross-arm.cmake index 5384c09c5a..9480fc0fe0 100644 --- a/cmake_targets/cross-arm.cmake +++ b/cmake_targets/cross-arm.cmake @@ -4,6 +4,8 @@ set(CMAKE_SYSTEM_PROCESSOR arm) set(CMAKE_C_COMPILER /usr/bin/aarch64-linux-gnu-gcc-11) set(CMAKE_CXX_COMPILER /usr/bin/aarch64-linux-gnu-g++-11) +set(ENV{PKG_CONFIG_LIBDIR} "/usr/lib/aarch64-linux-gnu/pkgconfig") + set(CROSS_COMPILE 1) set(bnProc_gen_128_DIR ${CMAKE_CURRENT_BINARY_DIR}/${NATIVE_DIR}) # /../build) set(bnProc_gen_avx2_DIR ${CMAKE_CURRENT_BINARY_DIR}/${NATIVE_DIR}) # /../build)