diff options
author | Krzysztof Adamski <k@japko.eu> | 2013-09-01 18:45:36 +0200 |
---|---|---|
committer | Krzysztof Adamski <k@japko.eu> | 2013-09-01 18:45:36 +0200 |
commit | 82b2fc2c8325830667ed780ae5402674c7b9bbf5 (patch) | |
tree | fdedf7e6e214cc16fdc540cbfa94dba14181b90b /CMakeLists.txt | |
parent | ac2e7dc6fb8edf6338aeed659ea179f0cffc32fd (diff) | |
download | libgit2-82b2fc2c8325830667ed780ae5402674c7b9bbf5.tar.gz |
Create ANDROID build option
CMake seems not to support Android as a target and this option
lets us test this in CMakeLists.txt.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 1c70ec2d6..a9b87b8a8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -29,6 +29,8 @@ OPTION( PROFILE "Generate profiling information" OFF ) OPTION( ENABLE_TRACE "Enables tracing support" OFF ) OPTION( LIBGIT2_FILENAME "Name of the produced binary" OFF ) +OPTION( ANDROID "Build for android NDK" OFF ) + IF(MSVC) # This option is only available when building with MSVC. By default, libgit2 # is build using the cdecl calling convention, which is useful if you're @@ -127,7 +129,7 @@ IF (ENABLE_TRACE STREQUAL "ON") ENDIF() # Include POSIX regex when it is required -IF(WIN32 OR AMIGA) +IF(WIN32 OR AMIGA OR ANDROID) INCLUDE_DIRECTORIES(deps/regex) SET(SRC_REGEX deps/regex/regex.c) ENDIF() @@ -409,7 +411,7 @@ ENDIF () IF (BUILD_EXAMPLES) FILE(GLOB_RECURSE EXAMPLE_SRC examples/network/*.c examples/network/*.h) ADD_EXECUTABLE(cgit2 ${EXAMPLE_SRC}) - IF(WIN32) + IF(WIN32 OR ANDROID) TARGET_LINK_LIBRARIES(cgit2 git2) ELSE() TARGET_LINK_LIBRARIES(cgit2 git2 pthread) |