From bf800ecb303359624c30e8f81174d5eaf8e84897 Mon Sep 17 00:00:00 2001 From: David Hampton Date: Thu, 26 Dec 2024 21:32:42 -0500 Subject: [PATCH] cmake: Fix cross-compilation to windows. The change committed in 6012678e98 causes a fatal error if the ffmpeg applications can't be found and used to determine its feature set. This is fine for local compiles but cross compiled executable can't be executed, so there's no point in requiring their existence (at this point in the compilation). Exempt cross compilation from this new check. --- mythtv/cmake/MythFindPackages.cmake | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mythtv/cmake/MythFindPackages.cmake b/mythtv/cmake/MythFindPackages.cmake index 6a5478152eb..3a2d460ee73 100644 --- a/mythtv/cmake/MythFindPackages.cmake +++ b/mythtv/cmake/MythFindPackages.cmake @@ -24,8 +24,9 @@ find_package(PkgConfig REQUIRED) # Packages provided by MythTV. These have no dependencies on MythTV and must # have already been compiled and installed by the super-package. # -if(CMAKE_SYSTEM_NAME MATCHES "Linux|Windows" AND CMAKE_SYSTEM_PROCESSOR MATCHES - "x86|aarch64") +if(NOT CMAKE_CROSSCOMPILING + AND CMAKE_SYSTEM_NAME MATCHES "Linux|Windows" + AND CMAKE_SYSTEM_PROCESSOR MATCHES "x86|aarch64") pkg_check_modules(FFNVCODEC ffnvcodec REQUIRED IMPORTED_TARGET) add_build_config(PkgConfig::FFNVCODEC "nvdec") if(TARGET PkgConfig::FFNVCODEC)