Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added x86_64, updated sdk to 8.4 #109

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 51 additions & 18 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ end

## build ffmpeg

SDK_VERSION='7.1'
SDK_VERSION='9.0'

XCODE_PATH='/Applications/Xcode.app/Contents/Developer/Platforms'
GCC_PATH='/Applications/XCode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang'
Expand All @@ -27,18 +27,28 @@ FFMPEG_BUILD_ARGS_SIM = [
'--disable-mmx',
'--arch=i386',
'--cpu=i386',
"--extra-ldflags='-arch i386 -miphoneos-version-min=6.0'",
"--extra-cflags='-arch i386 -miphoneos-version-min=6.0'",
"--extra-ldflags='-arch i386 -miphoneos-version-min=7.0'",
"--extra-cflags='-arch i386 -miphoneos-version-min=7.0 -fembed-bitcode'",
'--disable-asm',
]

FFMPEG_BUILD_ARGS_SIM_64 = [
'--assert-level=2',
'--disable-mmx',
'--arch=x86_64',
'--cpu=x86_64',
"--extra-ldflags='-arch x86_64 -miphoneos-version-min=7.0'",
"--extra-cflags='-arch x86_64 -miphoneos-version-min=7.0 -fembed-bitcode'",
'--disable-asm',
]

FFMPEG_BUILD_ARGS_ARMV7 = [
'--arch=arm',
'--cpu=cortex-a8',
'--enable-pic',
"--extra-cflags='-arch armv7 -miphoneos-version-min=6.0'",
"--extra-ldflags='-arch armv7 -miphoneos-version-min=6.0'",
"--extra-cflags='-mfpu=neon -mfloat-abi=softfp'",
"--extra-cflags='-arch armv7 -miphoneos-version-min=7.0 -fembed-bitcode'",
"--extra-ldflags='-arch armv7 -miphoneos-version-min=7.0'",
"--extra-cflags='-mfpu=neon -mfloat-abi=softfp -fembed-bitcode'",
'--enable-neon',
# '--disable-neon',
'--enable-optimizations',
Expand All @@ -53,9 +63,9 @@ FFMPEG_BUILD_ARGS_ARMV7S = [
'--arch=arm',
'--cpu=cortex-a9',
'--enable-pic',
"--extra-cflags='-arch armv7s -miphoneos-version-min=6.0'",
"--extra-ldflags='-arch armv7s -miphoneos-version-min=6.0'",
"--extra-cflags='-mfpu=neon -mfloat-abi=softfp'",
"--extra-cflags='-arch armv7s -miphoneos-version-min=7.0 -fembed-bitcode'",
"--extra-ldflags='-arch armv7s -miphoneos-version-min=7.0'",
"--extra-cflags='-mfpu=neon -mfloat-abi=softfp -fembed-bitcode'",
'--enable-neon',
# '--disable-neon',
'--enable-optimizations',
Expand All @@ -70,9 +80,9 @@ FFMPEG_BUILD_ARGS_ARM64 = [
'--arch=arm64',
# '--cpu=cortex-a9',
'--enable-pic',
"--extra-cflags='-arch arm64 -miphoneos-version-min=6.0'",
"--extra-ldflags='-arch arm64 -miphoneos-version-min=6.0'",
"--extra-cflags='-mfpu=neon -mfloat-abi=softfp'",
"--extra-cflags='-arch arm64 -miphoneos-version-min=7.0 -fembed-bitcode'",
"--extra-ldflags='-arch arm64 -miphoneos-version-min=7.0'",
"--extra-cflags='-mfpu=neon -mfloat-abi=softfp -fembed-bitcode'",
'--enable-neon',
# '--disable-neon',
'--enable-optimizations',
Expand Down Expand Up @@ -144,6 +154,8 @@ def buildArch(arch)
case arch
when 'i386'
args = mkArgs(PLATOFRM_PATH_SIM, SDK_PATH_SIM, FFMPEG_BUILD_ARGS_SIM)
when 'x86_64'
args = mkArgs(PLATOFRM_PATH_SIM, SDK_PATH_SIM, FFMPEG_BUILD_ARGS_SIM_64)
when 'armv7'
args = mkArgs(PLATOFRM_PATH_IOS, SDK_PATH_IOS, FFMPEG_BUILD_ARGS_ARMV7)
when 'armv7s'
Expand All @@ -164,7 +176,7 @@ def buildArch(arch)
end

def mkLipoArgs(lib)
"-create -arch armv7 armv7/#{lib}.a -arch armv7 armv7s/#{lib}.a -arch arm64 arm64/#{lib}.a -arch i386 i386/#{lib}.a -output universal/#{lib}.a"
"-create -arch armv7 armv7/#{lib}.a -arch armv7 armv7s/#{lib}.a -arch arm64 arm64/#{lib}.a -arch i386 i386/#{lib}.a -arch x86_64 x86_64/#{lib}.a -output universal/#{lib}.a"
end

desc "check gas-preprocessor.pl"
Expand Down Expand Up @@ -202,6 +214,11 @@ task :build_ffmpeg_i386 do
buildArch('i386')
end

desc "Build ffmpeg x86_64 libs"
task :build_ffmpeg_x86_64 do
buildArch('x86_64')
end

desc "Build ffmpeg armv7 libs"
task :build_ffmpeg_armv7 do
buildArch('armv7')
Expand Down Expand Up @@ -259,9 +276,16 @@ task :build_movie_debug do
system_or_exit "xcodebuild -project kxmovie.xcodeproj -target kxmovie -configuration Debug -sdk iphoneos#{SDK_VERSION} build SYMROOT=#{buildDir} -arch armv7s"
FileUtils.move Pathname.new('tmp/build/Debug-iphoneos/libkxmovie.a'), Pathname.new('tmp/build/Debug-iphoneos/libkxmovie_armv7s.a')

system_or_exit "xcodebuild -project kxmovie.xcodeproj -target kxmovie -configuration Debug -sdk iphoneos#{SDK_VERSION} build SYMROOT=#{buildDir} -arch arm64"
FileUtils.move Pathname.new('tmp/build/Debug-iphoneos/libkxmovie.a'), Pathname.new('tmp/build/Debug-iphoneos/libkxmovie_arm64.a')

system_or_exit "xcodebuild -project kxmovie.xcodeproj -target kxmovie -configuration Debug -sdk iphoneos#{SDK_VERSION} build SYMROOT=#{buildDir} -arch armv7"

system_or_exit "xcodebuild -project kxmovie.xcodeproj -target kxmovie -configuration Debug -sdk iphonesimulator#{SDK_VERSION} build SYMROOT=#{buildDir} -arch x86_64"
FileUtils.move Pathname.new('tmp/build/Debug-iphonesimulator/libkxmovie.a'), Pathname.new('tmp/build/Debug-iphonesimulator/libkxmovie_x86_64.a')

system_or_exit "xcodebuild -project kxmovie.xcodeproj -target kxmovie -configuration Debug -sdk iphonesimulator#{SDK_VERSION} build SYMROOT=#{buildDir}"
system_or_exit "lipo -create -arch armv7 tmp/build/Debug-iphoneos/libkxmovie.a -arch armv7 tmp/build/Debug-iphoneos/libkxmovie_armv7s.a -arch i386 tmp/build/Debug-iphonesimulator/libkxmovie.a -output tmp/build/libkxmovie.a"
system_or_exit "lipo -create -arch armv7 tmp/build/Debug-iphoneos/libkxmovie.a -arch armv7 tmp/build/Debug-iphoneos/libkxmovie_armv7s.a -arch arm64 tmp/build/Debug-iphoneos/libkxmovie_arm64.a -arch x86_64 tmp/build/Debug-iphonesimulator/libkxmovie_x86_64.a -arch i386 tmp/build/Debug-iphonesimulator/libkxmovie.a -output tmp/build/libkxmovie.a"
end

desc "Build libkxmovie-release"
Expand All @@ -270,9 +294,18 @@ task :build_movie_release do
system_or_exit "xcodebuild -project kxmovie.xcodeproj -target kxmovie -configuration Release -sdk iphoneos#{SDK_VERSION} build SYMROOT=#{buildDir} -arch armv7s"
FileUtils.move Pathname.new('tmp/build/Release-iphoneos/libkxmovie.a'), Pathname.new('tmp/build/Release-iphoneos/libkxmovie_armv7s.a')

system_or_exit "xcodebuild -project kxmovie.xcodeproj -target kxmovie -configuration Release -sdk iphoneos#{SDK_VERSION} build SYMROOT=#{buildDir} -arch arm64"
FileUtils.move Pathname.new('tmp/build/Release-iphoneos/libkxmovie.a'), Pathname.new('tmp/build/Release-iphoneos/libkxmovie_arm64.a')

system_or_exit "xcodebuild -project kxmovie.xcodeproj -target kxmovie -configuration Release -sdk iphoneos#{SDK_VERSION} build SYMROOT=#{buildDir} -arch armv7"
system_or_exit "xcodebuild -project kxmovie.xcodeproj -target kxmovie -configuration Debug -sdk iphonesimulator#{SDK_VERSION} build SYMROOT=#{buildDir}"
system_or_exit "lipo -create -arch armv7 tmp/build/Release-iphoneos/libkxmovie.a -arch armv7 tmp/build/Release-iphoneos/libkxmovie_armv7s.a -arch i386 tmp/build/Debug-iphonesimulator/libkxmovie.a -output tmp/build/libkxmovie.a"

system_or_exit "xcodebuild -project kxmovie.xcodeproj -target kxmovie -configuration Debug -sdk iphonesimulator#{SDK_VERSION} build SYMROOT=#{buildDir} -arch x86_64"

FileUtils.move Pathname.new('tmp/build/Debug-iphonesimulator/libkxmovie.a'), Pathname.new('tmp/build/Debug-iphonesimulator/libkxmovie_x86_64.a')

system_or_exit "xcodebuild -project kxmovie.xcodeproj -target kxmovie -configuration Debug -sdk iphonesimulator#{SDK_VERSION} build SYMROOT=#{buildDir}"

system_or_exit "lipo -create -arch armv7 tmp/build/Release-iphoneos/libkxmovie.a -arch armv7 tmp/build/Release-iphoneos/libkxmovie_armv7s.a -arch arm64 tmp/build/Release-iphoneos/libkxmovie_arm64.a -arch x86_64 tmp/build/Debug-iphonesimulator/libkxmovie_x86_64.a -arch i386 tmp/build/Debug-iphonesimulator/libkxmovie.a -output tmp/build/libkxmovie.a"

#FileUtils.copy Pathname.new('tmp/build/Release-iphoneos/libkxmovie.a'), buildDir
end
Expand All @@ -294,9 +327,9 @@ end

##
task :clean => [:clean_movie_debug, :clean_movie_release, :clean_ffmpeg]
task :build_ffmpeg => [:check_gas_preprocessor, :build_ffmpeg_armv7, :build_ffmpeg_armv7s, :build_ffmpeg_arm64, :build_ffmpeg_i386, :build_ffmpeg_universal]
task :build_ffmpeg => [:check_gas_preprocessor, :build_ffmpeg_armv7, :build_ffmpeg_armv7s, :build_ffmpeg_arm64, :build_ffmpeg_i386, :build_ffmpeg_x86_64, :build_ffmpeg_universal]
#task :build_movie => [:build_movie_debug, :copy_movie]
task :build_movie => [:build_movie_release, :copy_movie]
task :build_all => [:build_ffmpeg, :build_movie]
# task :default => [:build_all]
task :default => [:build_ffmpeg]
task :default => [:build_ffmpeg]
2 changes: 1 addition & 1 deletion gas-preprocessor
Submodule gas-preprocessor updated 2 files
+62 −26 gas-preprocessor.pl
+9 −0 test.S