Permalink
Browse files

Android task: NDK default search paths now favour ndk-bundle. Added m…

…acOS NDK search paths.
  • Loading branch information...
Felix Jones
Felix Jones committed Oct 7, 2016
1 parent 2d335da commit 5fd068eb4d5361adf162e1f9ddc9cd11ae96a566
Showing with 6 additions and 2 deletions.
  1. +6 −2 tasks/toolchains/android.rake
@@ -5,9 +5,12 @@ class MRuby::Toolchain::Android
DEFAULT_TOOLCHAIN = :clang
DEFAULT_NDK_HOMES = %w{
/usr/local/opt/android-ndk
/usr/local/opt/android-sdk/ndk-bundle
/usr/local/opt/android-ndk
%LOCALAPPDATA%/Android/android-sdk/ndk-bundle
%LOCALAPPDATA%/Android/android-ndk
~/Library/Android/sdk/ndk-bundle
~/Library/Android/ndk
}
TOOLCHAINS = [:clang] # TODO : Add gcc support
@@ -92,6 +95,7 @@ Set ANDROID_PLATFORM environment variable or set :platform parameter
DEFAULT_NDK_HOMES.find { |path|
path.gsub! '%LOCALAPPDATA%', ENV['LOCALAPPDATA'] || '%LOCALAPPDATA%'
path.gsub! '\\', '/'
path.gsub! '~', Dir.home || '~'
File.directory?(path)
} || raise(AndroidNDKHomeNotFound)
)
@@ -195,7 +199,7 @@ Set ANDROID_PLATFORM environment variable or set :platform parameter
flags += %W(-D__android__ --sysroot="#{sysroot}")
case toolchain
when :clang
flags += %W(-gcc-toolchain #{toolchain_path.to_s})
flags += %W(-gcc-toolchain "#{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)

0 comments on commit 5fd068e

Please sign in to comment.