mirror of
https://github.com/FEX-Emu/FEX.git
synced 2026-10-06 12:00:17 +02:00
Much like the prior xxhash PR. This one also has the advantage of making
it completely trivial to handle distros that only install zy{dis,core}-config.cmake
and not the PkgConfig files (Gentoo, Arch)
Working on both Gentoo and Arch (CMake), and Fedora (PkgConfig). Does
work on Ubuntu 22.04 though it gets rejected due to being too old, since
we require 4.0 or newer.
Signed-off-by: crueter <crueter@eden-emu.dev>
24 lines
570 B
CMake
24 lines
570 B
CMake
# SPDX-License-Identifier: MIT
|
|
|
|
if (CMAKE_CROSSCOMPILING)
|
|
return()
|
|
endif()
|
|
|
|
include(FindPackageHandleStandardArgs)
|
|
|
|
find_package(Zydis QUIET CONFIG)
|
|
|
|
if (Zydis_CONSIDERED_CONFIGS)
|
|
find_package_handle_standard_args(Zydis CONFIG_MODE)
|
|
else()
|
|
find_package(PkgConfig QUIET)
|
|
pkg_search_module(Zydis QUIET IMPORTED_TARGET zydis)
|
|
find_package_handle_standard_args(Zydis
|
|
REQUIRED_VARS zydis_LINK_LIBRARIES
|
|
VERSION_VAR zydis_VERSION)
|
|
|
|
if (TARGET PkgConfig::zydis)
|
|
add_library(Zydis::Zydis ALIAS PkgConfig::zydis)
|
|
endif()
|
|
endif()
|