CMake: Don't use pkgconfig when cross-compiling

This commit is contained in:
Tony Wasserka 2024-09-06 10:22:33 +02:00
parent 355c3428c0
commit ab5d3ab22b

View File

@ -287,7 +287,7 @@ find_package(Python 3.0 REQUIRED COMPONENTS Interpreter)
set(BUILD_SHARED_LIBS OFF)
pkg_search_module(xxhash IMPORTED_TARGET xxhash libxxhash)
if (TARGET PkgConfig::xxhash)
if (TARGET PkgConfig::xxhash AND NOT CMAKE_CROSSCOMPILING)
add_library(xxHash::xxhash ALIAS PkgConfig::xxhash)
else()
set(XXHASH_BUNDLED_MODE TRUE)