From ad4002c17b3e53f48b4e91e57cad94b6c962bac4 Mon Sep 17 00:00:00 2001 From: Juha Alanen Date: Thu, 23 Jan 2020 14:24:09 +0200 Subject: [test] Enable HTTP server on Android --- next/platform/android/android.cmake | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'next/platform/android/android.cmake') diff --git a/next/platform/android/android.cmake b/next/platform/android/android.cmake index 454e11bcd2..1f77d0a29a 100644 --- a/next/platform/android/android.cmake +++ b/next/platform/android/android.cmake @@ -329,7 +329,6 @@ add_library( ${MBGL_ROOT}/platform/default/src/mbgl/text/local_glyph_rasterizer.cpp ${MBGL_ROOT}/platform/android/src/test/collator_test_stub.cpp ${MBGL_ROOT}/platform/android/src/test/number_format_test_stub.cpp - ${MBGL_ROOT}/platform/android/src/test/http_file_source_test_stub.cpp ) target_include_directories( @@ -347,6 +346,29 @@ target_link_libraries( -Wl,--no-whole-archive ) +if(ANDROID_NATIVE_API_LEVEL VERSION_LESS 24) + target_sources( + mbgl-test-runner + PRIVATE ${MBGL_ROOT}/platform/android/src/test/http_file_source_test_stub.cpp + ) +else() + set(CURL_DIR ${MBGL_ROOT}/vendor/curl-android-ios/prebuilt-with-ssl/android) + set(CURL_LIBRARY ${CURL_DIR}/${ANDROID_ABI}/libcurl.a) + + target_sources( + mbgl-test-runner + PRIVATE ${MBGL_ROOT}/platform/default/src/mbgl/storage/http_file_source.cpp + ) + target_include_directories( + mbgl-test-runner + PRIVATE ${CURL_DIR}/include + ) + target_link_libraries( + mbgl-test-runner + PRIVATE ${CURL_LIBRARY} + ) +endif() + add_custom_command( TARGET mbgl-test-runner PRE_BUILD COMMAND -- cgit v1.2.1