Fix building on darwin-x86_64 with clang
authorJesse Hall <jessehall@google.com>
Fri, 16 Oct 2015 02:44:21 +0000 (19:44 -0700)
committerPyry Haulos <phaulos@google.com>
Fri, 16 Oct 2015 15:07:00 +0000 (15:07 +0000)
Change-Id: I258a707662f90777a4e7c2555f9ba9ee9106fa26

android/scripts/common.py
framework/delibs/cmake/toolchain-android-r10e.cmake

index f9d36b5269034362d0e8c05913cb0bb17c42068f..888f4decb2476c3217b4ac41f9e88b976fb341fb 100644 (file)
@@ -213,7 +213,7 @@ NDK_HOST_OS_NAMES = [
        "windows",
        "windows_x86-64",
        "darwin-x86",
-       "darwin-x86-64",
+       "darwin-x86_64",
        "linux-x86",
        "linux-x86_64"
 ]
@@ -273,6 +273,7 @@ EXTRA_BUILD_ARGS            = getExtraBuildArgs(CMAKE_GENERATOR)
 
 # SDK paths
 ANDROID_SDK_PATH               = selectFirstExistingDir([
+               os.environ.get("ANDROID_SDK_PATH", None),
                os.path.expanduser("~/android-sdk-linux"),
                os.path.expanduser("~/android-sdk-mac_x86"),
                "C:/android/android-sdk-windows",
index 25fe7304915cf1168e3adc60fa1cbd5618a52bbd..15245d855b97a2a715d234c5a3a6aee09fbfbd61 100644 (file)
@@ -144,10 +144,12 @@ elseif (DE_COMPILER STREQUAL "DE_COMPILER_CLANG")
 
        if (ANDROID_NDK_HOST_OS STREQUAL "linux-x86" OR
                ANDROID_NDK_HOST_OS STREQUAL "linux-x86_64" OR
-               ANDROID_NDK_HOST_OS STREQUAL "darwin-x86")
+               ANDROID_NDK_HOST_OS STREQUAL "darwin-x86" OR
+               ANDROID_NDK_HOST_OS STREQUAL "darwin-x86_64")
                cmake_force_c_compiler("${LLVM_PATH}bin/clang"                  Clang)
                cmake_force_cxx_compiler("${LLVM_PATH}bin/clang++"              Clang)
                set(CMAKE_AR "${LLVM_PATH}/bin/llvm-ar" CACHE FILEPATH "Archiver")
+               set(CMAKE_RANLIB "${CROSS_COMPILE}ranlib" CACHE FILEPATH "Indexer")
        elseif (ANDROID_NDK_HOST_OS STREQUAL "windows")
                cmake_force_c_compiler("${LLVM_PATH}bin/clang.exe"              Clang)
                cmake_force_cxx_compiler("${LLVM_PATH}bin/clang++.exe"  Clang)