mirror of
https://github.com/zhigang1992/RubyMotion.git
synced 2026-01-12 22:51:55 +08:00
not embed kernel-*.bc into each compiled files
http://hipbyte.myjetbrains.com/youtrack/issue/RM-652
This commit is contained in:
@@ -20,28 +20,46 @@ task :vm_files do
|
||||
sdk = File.join('osx', sdk_version, 'MacOSX')
|
||||
mkdir_p sdk
|
||||
objs = "../vm/MacOSX#{sdk_version}.objs"
|
||||
kernels = []
|
||||
Dir.glob(File.join(objs, 'kernel-*.bc')).each do |path|
|
||||
install path, sdk
|
||||
arch = path.match(/kernel-(.+).bc/)[1]
|
||||
sh "/usr/bin/clang -fexceptions -c -arch #{arch} -mmacosx-version-min=#{sdk_version} #{path} -o /tmp/kernel-#{arch}.o"
|
||||
kernels << "/tmp/kernel-#{arch}.o"
|
||||
end
|
||||
install File.join(objs, 'librubymotion-static.a'), sdk
|
||||
sh "/usr/bin/lipo -create #{kernels.join(' ')} -output /tmp/kernel.o"
|
||||
install "/tmp/kernel.o", sdk
|
||||
end
|
||||
|
||||
IOS_SDK_VERSIONS.each do |sdk_version|
|
||||
ios = File.join('ios', sdk_version, 'iPhoneOS')
|
||||
mkdir_p ios
|
||||
objs = "../vm/iPhoneOS#{sdk_version}.objs"
|
||||
kernels = []
|
||||
Dir.glob(File.join(objs, 'kernel-*.bc')).each do |path|
|
||||
install path, ios
|
||||
arch = path.match(/kernel-(.+).bc/)[1]
|
||||
sh "/usr/bin/clang -fexceptions -c -arch #{arch} -miphoneos-version-min=#{sdk_version} #{path} -o /tmp/kernel-#{arch}.o"
|
||||
kernels << "/tmp/kernel-#{arch}.o"
|
||||
end
|
||||
install File.join(objs, 'librubymotion-static.a'), ios
|
||||
sh "/usr/bin/lipo -create #{kernels.join(' ')} -output /tmp/kernel.o"
|
||||
install "/tmp/kernel.o", ios
|
||||
|
||||
sim = File.join('ios', sdk_version, 'iPhoneSimulator')
|
||||
mkdir_p sim
|
||||
objs = "../vm/iPhoneSimulator#{sdk_version}.objs"
|
||||
kernels = []
|
||||
Dir.glob(File.join(objs, 'kernel-*.bc')).each do |path|
|
||||
install path, sim
|
||||
arch = path.match(/kernel-(.+).bc/)[1]
|
||||
sh "/usr/bin/clang -fexceptions -c -arch #{arch} -miphoneos-version-min=#{sdk_version} #{path} -o /tmp/kernel-#{arch}.o"
|
||||
kernels << "/tmp/kernel-#{arch}.o"
|
||||
end
|
||||
install File.join(objs, 'librubymotion-static.a'), sim
|
||||
sh "/usr/bin/lipo -create #{kernels.join(' ')} -output /tmp/kernel.o"
|
||||
install "/tmp/kernel.o", sim
|
||||
end
|
||||
|
||||
if OSX_SDK_VERSIONS.size > 1 and ENV['SDK_BETA'] == nil
|
||||
|
||||
@@ -317,7 +317,8 @@ EOS
|
||||
objs_file = Tempfile.new('linker-objs-list')
|
||||
objs_list.each { |obj| objs_file.puts(obj) }
|
||||
objs_file.close # flush
|
||||
sh "#{cxx} -o \"#{main_exec}\" -filelist \"#{objs_file.path}\" #{config.ldflags(platform)} -L#{File.join(datadir, platform)} -lrubymotion-static -lobjc -licucore #{linker_option} #{framework_search_paths} #{frameworks} #{weak_frameworks} #{config.libs.join(' ')} #{vendor_libs}"
|
||||
kernel = File.join(datadir, platform, "kernel.o")
|
||||
sh "#{cxx} -o \"#{main_exec}\" \"#{kernel}\" -filelist \"#{objs_file.path}\" #{config.ldflags(platform)} -L#{File.join(datadir, platform)} -lrubymotion-static -lobjc -licucore #{linker_option} #{framework_search_paths} #{frameworks} #{weak_frameworks} #{config.libs.join(' ')} #{vendor_libs}"
|
||||
main_exec_created = true
|
||||
|
||||
# Change the install name of embedded frameworks.
|
||||
|
||||
@@ -349,7 +349,8 @@ EOS
|
||||
"-stdlib=libstdc++"
|
||||
end
|
||||
end || ""
|
||||
sh "#{cxx} -o \"#{main_exec}\" #{objs_list} #{config.ldflags(platform)} -L#{File.join(datadir, platform)} -lrubymotion-static -lobjc -licucore #{linker_option} #{framework_search_paths} #{frameworks} #{weak_frameworks} #{config.libs.join(' ')} #{vendor_libs}"
|
||||
kernel = File.join(datadir, platform, "kernel.o")
|
||||
sh "#{cxx} -o \"#{main_exec}\" \"#{kernel}\" #{objs_list} #{config.ldflags(platform)} -L#{File.join(datadir, platform)} -lrubymotion-static -lobjc -licucore #{linker_option} #{framework_search_paths} #{frameworks} #{weak_frameworks} #{config.libs.join(' ')} #{vendor_libs}"
|
||||
main_exec_created = true
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user