aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorTim Barron <tjbarron@google.com>2020-05-13 22:31:00 +0000
committerTim Barron <tjbarron@google.com>2020-05-14 16:59:21 +0000
commitb47184c5946c12c998f908a0fb01d9b99eac8c33 (patch)
tree19b5ef3a23eb4d241bede95834ebb59bdccdcd60 /CMakeLists.txt
parentf0f25e4a51a6f843bdd169d76149f026c933abef (diff)
downloadicing-b47184c5946c12c998f908a0fb01d9b99eac8c33.tar.gz
Modify external/icing CMake to build against libandroidicu.
This resolves compiler/linker issues with building external/icing against icu. Change-Id: I6fce71df9dd65c062273d73fc5b1b188ecea9ffc
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt8
1 files changed, 7 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 398b35e..f2a5407 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -76,6 +76,11 @@ message(STATUS "Icing_PROTO_SOURCES=${Icing_PROTO_SOURCES}")
set(protobuf_BUILD_TESTS OFF CACHE BOOL "")
add_subdirectory("${Protobuf_SOURCE_DIR}/cmake" ${Protobuf_TARGET_BINARY_DIR})
+# Compile libandroidicu
+set(ICU_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../icu/libandroidicu")
+set(ICU_TARGET_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/icu-target")
+add_subdirectory(${ICU_SOURCE_DIR} ${ICU_TARGET_BINARY_DIR})
+
# Glob Icing C++ sources
# TODO: When supporting cmake v3.12 or higher, use CONFIGURE_DEPENDS in the glob
# below so that cmake knows when to re-generate the makefiles.
@@ -110,4 +115,5 @@ add_library(
target_include_directories(icing PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
target_include_directories(icing PRIVATE ${Icing_PROTO_GEN_DIR})
target_include_directories(icing PRIVATE "${Protobuf_SOURCE_DIR}/src")
-target_link_libraries(icing protobuf::libprotobuf log)
+target_include_directories(icing PRIVATE "${ICU_SOURCE_DIR}/include")
+target_link_libraries(icing protobuf::libprotobuf libandroidicu log)