[x265] [PATCH] cmake: revive Xcode support (tip cmake now supports Xcode 5)
Steve Borho
steve at borho.org
Fri Nov 22 01:05:53 CET 2013
# HG changeset patch
# User Steve Borho <steve at borho.org>
# Date 1385078626 21600
# Thu Nov 21 18:03:46 2013 -0600
# Node ID bb8da7de54346d1825d1fe416fa9183c0a811396
# Parent 8f156b97360be563a52743826bded075bd98b267
cmake: revive Xcode support (tip cmake now supports Xcode 5)
macbrew install cmake --HEAD
cmake -G Xcode ../source
open x265.xcodeproj
> cmake --version
cmake version 2.8.12.20131121
diff -r 8f156b97360b -r bb8da7de5434 source/CMakeLists.txt
--- a/source/CMakeLists.txt Thu Nov 21 17:29:26 2013 -0600
+++ b/source/CMakeLists.txt Thu Nov 21 18:03:46 2013 -0600
@@ -151,14 +151,22 @@
add_subdirectory(common)
add_subdirectory(encoder)
-if(MSVC_IDE AND ENABLE_PRIMITIVES_ASM)
+if((MSVC_IDE OR XCODE) AND ENABLE_PRIMITIVES_ASM)
# this is horrible. ugly, and hacky, and it reproduces logic found
# in the yasm CMake modules, but this is required because of this cmake bug
# http://www.cmake.org/Bug/print_bug_page.php?bug_id=8170
if (X64)
- set(FLAGS -f win64 -m amd64 -DARCH_X86_64=1 -DHAVE_ALIGNED_STACK=0)
+ if(APPLE)
+ set(FLAGS -f macho64 -DPREFIX -DARCH_X86_64=1 -DHAVE_ALIGNED_STACK=0)
+ else()
+ set(FLAGS -f win64 -m amd64 -DARCH_X86_64=1 -DHAVE_ALIGNED_STACK=0)
+ endif()
else()
- set(FLAGS -f win32 -DARCH_X86_64=0 -DHAVE_ALIGNED_STACK=0 -DPREFIX)
+ if(APPLE)
+ set(FLAGS -f macho -DARCH_X86_64=0 -DHAVE_ALIGNED_STACK=0 -DPREFIX)
+ else()
+ set(FLAGS -f win32 -DARCH_X86_64=0 -DHAVE_ALIGNED_STACK=0 -DPREFIX)
+ endif()
endif()
if (HIGH_BIT_DEPTH)
set(FLAGS ${FLAGS} -DHIGH_BIT_DEPTH=1 -DBIT_DEPTH=10)
diff -r 8f156b97360b -r bb8da7de5434 source/Lib/TLibEncoder/TEncSearch.cpp
--- a/source/Lib/TLibEncoder/TEncSearch.cpp Thu Nov 21 17:29:26 2013 -0600
+++ b/source/Lib/TLibEncoder/TEncSearch.cpp Thu Nov 21 18:03:46 2013 -0600
@@ -458,9 +458,9 @@
}
//===== get residual signal =====
- assert(!((uint32_t)fenc & (width - 1)));
- assert(!((uint32_t)pred & (width - 1)));
- assert(!((uint32_t)residual & (width - 1)));
+ assert(!((uint32_t)(size_t)fenc & (width - 1)));
+ assert(!((uint32_t)(size_t)pred & (width - 1)));
+ assert(!((uint32_t)(size_t)residual & (width - 1)));
primitives.calcresidual[(int)g_convertToBit[width]](fenc, pred, residual, stride);
//===== transform and quantization =====
@@ -499,7 +499,6 @@
}
//===== reconstruction =====
- assert(((uint32_t)residual & (width - 1)) == 0);
assert(width <= 32);
primitives.calcrecon[size](pred, residual, recon, reconQt, reconIPred, stride, MAX_CU_SIZE, reconIPredStride);
@@ -587,9 +586,9 @@
}
//===== get residual signal =====
- assert(!((uint32_t)fenc & (width - 1)));
- assert(!((uint32_t)pred & (width - 1)));
- assert(!((uint32_t)residual & (width - 1)));
+ assert(!((uint32_t)(size_t)fenc & (width - 1)));
+ assert(!((uint32_t)(size_t)pred & (width - 1)));
+ assert(!((uint32_t)(size_t)residual & (width - 1)));
int size = g_convertToBit[width];
primitives.calcresidual[size](fenc, pred, residual, stride);
@@ -638,7 +637,7 @@
}
//===== reconstruction =====
- assert(((uint32_t)residual & (width - 1)) == 0);
+ assert(((uint32_t)(size_t)residual & (width - 1)) == 0);
assert(width <= 32);
primitives.calcrecon[size](pred, residual, recon, reconQt, reconIPred, stride, MAX_CU_SIZE / 2, reconIPredStride);
diff -r 8f156b97360b -r bb8da7de5434 source/common/CMakeLists.txt
--- a/source/common/CMakeLists.txt Thu Nov 21 17:29:26 2013 -0600
+++ b/source/common/CMakeLists.txt Thu Nov 21 18:03:46 2013 -0600
@@ -119,7 +119,7 @@
set(A_SRCS ${A_SRCS} pixel-32.asm)
endif()
- if(MSVC_IDE)
+ if(MSVC_IDE OR XCODE)
# MSVC requires custom build rules in the main cmake script for yasm
set(MSVC_ASMS "${A_SRCS}" CACHE INTERNAL "yasm sources")
set(A_SRCS)
More information about the x265-devel
mailing list