Skip to content

Commit

Permalink
Set default linker 'flags' and 'flags_before_libraries'.
Browse files Browse the repository at this point in the history
  • Loading branch information
crimsonwoods committed Feb 14, 2017
1 parent ba812d2 commit 83a3da4
Showing 1 changed file with 30 additions and 1 deletion.
31 changes: 30 additions & 1 deletion tasks/toolchains/android.rake
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,34 @@ Set ANDROID_PLATFORM environment variable or set :platform parameter
flags
end

def ldflags
flags = []

flags += %W(--sysroot="#{sysroot}")

flags
end

def ldflags_before_libraries
flags = []

case toolchain
when :clang
flags += %W(-gcc-toolchain "#{gcc_toolchain_path.to_s}")
case arch
when /armeabi-v7a/ then flags += %W(-target armv7-none-linux-androideabi)
when /armeabi/ then flags += %W(-target armv5te-none-linux-androideabi)
when /arm64-v8a/ then flags += %W(-target aarch64-none-linux-android)
when /x86_64/ then flags += %W(-target x86_64-none-linux-android)
when /x86/ then flags += %W(-target i686-none-linux-android)
when /mips64/ then flags += %W(-target mips64el-none-linux-android)
when /mips/ then flags += %W(-target mipsel-none-linux-android)
end
end
flags += %W(-no-canonical-prefixes)

flags
end
end

MRuby::Toolchain.new(:android) do |conf, params|
Expand All @@ -246,5 +274,6 @@ MRuby::Toolchain.new(:android) do |conf, params|

conf.archiver.command = android.ar
conf.linker.command = android.cc
conf.linker.flags = []
conf.linker.flags = android.ldflags
conf.linker.flags_before_libraries = android.ldflags_before_libraries
end

0 comments on commit 83a3da4

Please sign in to comment.