From aafe9a44359e87fb425049139f1083a625e96d84 Mon Sep 17 00:00:00 2001 From: Matthieu Gautier Date: Wed, 22 Feb 2017 16:56:21 +0100 Subject: [PATCH] [ANDROID] Deactivate some features if we are compiling for android. Android libc doesn't support all thread feature (as pthread_cancel). Do not compile those files if we are compiling for android. --- include/meson.build | 5 ++++- meson_options.txt | 4 +++- src/meson.build | 10 ++++++++-- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/include/meson.build b/include/meson.build index e1ec8db36..70e78ad84 100644 --- a/include/meson.build +++ b/include/meson.build @@ -1,11 +1,14 @@ headers = [ - 'indexer.h', 'library.h', 'manager.h', 'reader.h', 'searcher.h' ] +if not get_option('android') + headers += ['indexer.h'] +endif + if xapian_dep.found() headers += ['xapianIndexer.h', 'xapianSearcher.h'] endif diff --git a/meson_options.txt b/meson_options.txt index 23c06234d..518f4b378 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -1,2 +1,4 @@ option('ctpp2-install-prefix', type : 'string', value : '', - description : 'Prefix where ctpp libs has been installed') \ No newline at end of file + description : 'Prefix where ctpp libs has been installed') +option('android', type : 'boolean', value : false, + description : 'Do we make a kiwix-lib for android') diff --git a/src/meson.build b/src/meson.build index 6046dd99a..969ee670c 100644 --- a/src/meson.build +++ b/src/meson.build @@ -3,7 +3,6 @@ kiwix_sources = [ 'manager.cpp', 'reader.cpp', 'searcher.cpp', - 'indexer.cpp', 'common/base64.cpp', 'common/pathTools.cpp', 'common/regexTools.cpp', @@ -16,7 +15,14 @@ kiwix_sources = [ kiwix_sources += lib_resources if xapian_dep.found() - kiwix_sources += ['xapianIndexer.cpp', 'xapianSearcher.cpp'] + kiwix_sources += ['xapianSearcher.cpp'] + if not get_option('android') + kiwix_sources += ['xapianIndexer.cpp'] + endif +endif + +if not get_option('android') + kiwix_sources += ['indexer.cpp'] endif if has_ctpp2_dep