-
Notifications
You must be signed in to change notification settings - Fork 10
Required patch for CMake 4 on MacOS #30
Copy link
Copy link
Open
Description
This patch is required until upstream releases a fixed version (copied from the Homebrew file)
diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt
index e5b098297..a03d9c405 100755
--- a/source/CMakeLists.txt
+++ b/source/CMakeLists.txt
@@ -6,18 +6,14 @@ if(NOT CMAKE_BUILD_TYPE)
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)
@@ -148,7 +144,7 @@ if(APPLE)
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)
set(COMPILER_NAME clang)
endif()
@@ -604,6 +600,9 @@ if((MSVC_IDE OR XCODE OR GCC) AND ENABLE_ASSEMBLY)
elseif(ARM64 OR CROSS_COMPILE_ARM64)
# compile ARM64 arch asm files here
enable_language(ASM)
+ if(APPLE)
+ set(ARM_ARGS ${ARM_ARGS} -arch arm64)
+ endif()
foreach(ASM ${ARM_ASMS})
set(ASM_SRC ${CMAKE_CURRENT_SOURCE_DIR}/common/aarch64/${ASM})
list(APPEND ASM_SRCS ${ASM_SRC})I also needed to specify these command line args: -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DCMAKE_PREFIX_PATH="$(brew --prefix)" -DCMAKE_REQUIRED_INCLUDES="$(brew --prefix)/include"
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels