diff --git a/Rakefile b/Rakefile index ea4532f2..d527c362 100644 --- a/Rakefile +++ b/Rakefile @@ -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' @@ -27,8 +27,18 @@ 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', ] @@ -36,9 +46,9 @@ 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', @@ -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', @@ -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', @@ -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' @@ -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" @@ -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') @@ -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" @@ -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 @@ -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] \ No newline at end of file diff --git a/gas-preprocessor b/gas-preprocessor index cafe6e55..dd811e7a 160000 --- a/gas-preprocessor +++ b/gas-preprocessor @@ -1 +1 @@ -Subproject commit cafe6e55a5606c5423c0a0e4045a97f2c3a86338 +Subproject commit dd811e7a8403ef762e333909c54c24674ee04892