Skip to content

Commit

Permalink
Add support for building for Android (currently only build egltrace.so)
Browse files Browse the repository at this point in the history
Signed-off-by: José Fonseca <[email protected]>
  • Loading branch information
George Wright authored and jrfonseca committed Mar 17, 2012
1 parent 70c3470 commit a4a643e
Show file tree
Hide file tree
Showing 4 changed files with 432 additions and 1 deletion.
11 changes: 10 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,16 @@ set (CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)

set (CMAKE_USE_PYTHON_VERSION 2.7 2.6)

find_package (PythonInterp REQUIRED)
if (ANDROID)
set (ENABLE_GUI false)
set (ENABLE_CLI false)
else ()
macro (find_host_package)
find_package (${ARGN})
endmacro()
endif ()

find_host_package (PythonInterp REQUIRED)
find_package (Threads)

if (ENABLE_GUI)
Expand Down
14 changes: 14 additions & 0 deletions INSTALL.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,20 @@ doing:
cmake -H. -Bbuild32 -DCMAKE_C_FLAGS=-m32 -DCMAKE_CXX_FLAGS=-m32 -DCMAKE_EXE_LINKER_FLAGS=-m32 -DENABLE_GUI=FALSE
make -C build32 glxtrace

Android
-------

Additional requirements:

* [Android NDK](http://developer.android.com/sdk/ndk/index.html)

Build as:

export ANDROID_NDK=/path/to/your/ndk
cmake -DCMAKE_TOOLCHAIN_FILE=cmake/toolchain/android.toolchain.cmake -DANDROID_API_LEVEL=9 -H. -Bbuild
make -C build

This will generate a libapitrace.so in your `libs/armeabi-v7a/` directory that can be used.

Windows
-------
Expand Down
1 change: 1 addition & 0 deletions cmake/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
!*.cmake
Loading

0 comments on commit a4a643e

Please sign in to comment.