]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
Fix CMake build error with latest CMake 4.0 release
authorUkn Unknown <4031821+uknunknown@users.noreply.github.com>
Sun, 22 Feb 2026 20:06:12 +0000 (12:06 -0800)
committerFlole <Flole998@users.noreply.github.com>
Mon, 23 Feb 2026 07:43:44 +0000 (08:43 +0100)
- Fix CMake build error with latest CMake 4.0 release
- Fix also CMake for MacOS

Makefile.ffmpeg
support/patches/libx265.CMake4.diff [new file with mode: 0644]

index 7b6353df4cd1e3d2a5c8d6fdbe16b5cf544771c5..5cbcc8b77bb6d99cad09a4bdf3af0ffe1c5f88d3 100644 (file)
@@ -63,6 +63,7 @@ LIBX265_TB     = $(LIBX265).tar.gz
 LIBX265_URL    = https://ftp.videolan.org/pub/videolan/x265/$(LIBX265_TB)
 LIBX265_SHA1   = 11880a3aa9e4ee618f539a2d6a8ece0ea442f505
 LIBX265_DIFFS  = libx265.pic.diff
+LIBX265_DIFFS  += libx265.CMake4.diff
 LIBX265_DIFFS  += libx265-silence.patch
 LIBX265_DIFFS  += libx265-substring.patch
 LIBX265_DIFFS  += libx265-armv9.patch
diff --git a/support/patches/libx265.CMake4.diff b/support/patches/libx265.CMake4.diff
new file mode 100644 (file)
index 0000000..ea0f794
--- /dev/null
@@ -0,0 +1,44 @@
+diff -urN ../x265_4.1/source/CMakeLists.txt ./source/CMakeLists.txt
+--- ../x265_4.1/source/CMakeLists.txt  2026-02-21 21:21:19.467544361 -0800
++++ ./source/CMakeLists.txt    2026-02-21 21:26:27.597691907 -0800
+@@ -6,18 +6,14 @@
+         FORCE)
+ endif()
+ message(STATUS "cmake version ${CMAKE_VERSION}")
+-if(POLICY CMP0025)
+-    cmake_policy(SET CMP0025 OLD) # report Apple's Clang as just Clang
+-endif()
++
+ if(POLICY CMP0042)
+     cmake_policy(SET CMP0042 NEW) # MACOSX_RPATH
+ endif()
+-if(POLICY CMP0054)
+-    cmake_policy(SET CMP0054 OLD) # Only interpret if() arguments as variables or keywords when unquoted
+-endif()
++
+ project (x265)
+-cmake_minimum_required (VERSION 2.8.8) # OBJECT libraries require 2.8.8
++cmake_minimum_required (VERSION 2.8.8...3.10) # OBJECT libraries require 2.8.8
+ include(CheckIncludeFiles)
+ include(CheckFunctionExists)
+ include(CheckSymbolExists)
+@@ -168,7 +164,7 @@
+   add_definitions(-DMACOS=1)
+ endif()
+-if(${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")
++if(${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang" OR ${CMAKE_CXX_COMPILER_ID} STREQUAL "AppleClang")
+     set(CLANG 1)
+ endif()
+ if(${CMAKE_CXX_COMPILER_ID} STREQUAL "Intel")
+@@ -723,6 +719,9 @@
+     if(ARM OR CROSS_COMPILE_ARM)
+     # compile ARM arch asm files here
+         enable_language(ASM)
++        if(APPLE)
++            set(ARM_ARGS ${ARM_ARGS} -arch ${CMAKE_OSX_ARCHITECTURES})
++        endif()
+         foreach(ASM ${ARM_ASMS})
+                       set(ASM_SRC ${CMAKE_CURRENT_SOURCE_DIR}/common/arm/${ASM})
+             list(APPEND ASM_SRCS ${ASM_SRC})