|
1 | 1 | cmake_minimum_required(VERSION 2.8.12)
|
2 | 2 |
|
| 3 | +# Configure some stuff that needs to be set really early |
| 4 | +if(BUILD_ANDROID) |
| 5 | + set(CMAKE_TOOLCHAIN_FILE |
| 6 | + "${CMAKE_SOURCE_DIR}/scripts/android.toolchain.cmake" |
| 7 | + CACHE STRING |
| 8 | + "The Android toolchain file") |
| 9 | + |
| 10 | + # Default to arm64 if nothing is specified on the command line. |
| 11 | + set(ANDROID_ABI "arm64-v8a" CACHE STRING "The Android ABI to build for") |
| 12 | + |
| 13 | + # This will be overridden later, we just need to set it now so that the |
| 14 | + # configuration will continue on to where the toolchain is available |
| 15 | + if(WIN32) |
| 16 | + set(CMAKE_MAKE_PROGRAM |
| 17 | + "android-make-not-found" |
| 18 | + CACHE STRING |
| 19 | + "The path to the NDK's make.exe to use") |
| 20 | + endif() |
| 21 | +endif() |
| 22 | + |
3 | 23 | # disallow in-source builds because we have a top-level wrapper Makefile
|
4 | 24 | if(CMAKE_BINARY_DIR STREQUAL CMAKE_SOURCE_DIR)
|
5 | 25 | message(FATAL_ERROR "In-source builds not allowed")
|
@@ -34,6 +54,33 @@ if(WIN32)
|
34 | 54 | message(FATAL_ERROR "CMake is not needed on Windows, just open and build renderdoc.sln")
|
35 | 55 | endif()
|
36 | 56 |
|
| 57 | +if(ANDROID) |
| 58 | + message(STATUS "Disabling GL driver on android - no support for EGL/GLES") |
| 59 | + set(ENABLE_GL OFF CACHE BOOL "" FORCE) |
| 60 | + |
| 61 | + # Android doesn't support the Qt UI for obvious reasons |
| 62 | + message(STATUS "Disabling qrenderdoc for android build") |
| 63 | + set(ENABLE_QRENDERDOC OFF CACHE BOOL "" FORCE) |
| 64 | + |
| 65 | + message(STATUS "Using Android ABI ${ANDROID_ABI}") |
| 66 | + message(STATUS "Using Android native API level ${ANDROID_NATIVE_API_LEVEL}") |
| 67 | + |
| 68 | + if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows") |
| 69 | + set(MAKE_SEARCH_DIRS "windows-x86_64" "windows") |
| 70 | + |
| 71 | + # For windows, we need to use the make program in the NDK |
| 72 | + foreach(dir ${MAKE_SEARCH_DIRS}) |
| 73 | + set(__makepath "${ANDROID_NDK}/prebuilt/${dir}/bin/make.exe") |
| 74 | + if( EXISTS "${__makepath}" ) |
| 75 | + set(CMAKE_MAKE_PROGRAM "${__makepath}" CACHE STRING "" FORCE) |
| 76 | + break() |
| 77 | + endif() |
| 78 | + endforeach() |
| 79 | + |
| 80 | + message(STATUS "Using build tool ${CMAKE_MAKE_PROGRAM}") |
| 81 | + endif() |
| 82 | +endif() |
| 83 | + |
37 | 84 | set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
|
38 | 85 | set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
|
39 | 86 |
|
|
0 commit comments