cmake: prefer system libraries (#216)

This commit is contained in:
Alexandre Bouvier 2024-06-27 12:46:55 +02:00 committed by GitHub
parent f522948df8
commit f5541e3c3d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 147 additions and 65 deletions

15
cmake/FindxxHash.cmake Normal file
View file

@ -0,0 +1,15 @@
# SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
# SPDX-License-Identifier: GPL-2.0-or-later
find_package(PkgConfig QUIET)
pkg_search_module(XXHASH QUIET IMPORTED_TARGET libxxhash)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(xxHash
REQUIRED_VARS XXHASH_LINK_LIBRARIES
VERSION_VAR XXHASH_VERSION
)
if (xxHash_FOUND AND NOT TARGET xxHash::xxhash)
add_library(xxHash::xxhash ALIAS PkgConfig::XXHASH)
endif()