cpp_client_telemetry
cpp_client_telemetry copied to clipboard
Fix CMakeLists.txt for Android builds
Add
if(ANDROID)
list(APPEND SRCS
offline/OfflineStorage_Room.cpp
)
else()
list(APPEND SRCS
offline/OfflineStorage_SQLite.cpp
)
endif()
For lib/CMakeLists.txt for Droid compilation.
list(APPEND SRCS
pal/posix/NetworkInformationImpl.mm
# TODO: this unit below needs to be deprecated and removed
../third_party/Reachability/ODWReachability.m
)
//Add this elseif block elseif(ANDROID) list(APPEND SRCS http/HttpClient_Android.cpp http/HttpClient_Android.hpp pal/posix/NetworkInformationImpl.cpp ) else() list(APPEND SRCS http/HttpClient_Curl.cpp http/HttpClient_Curl.hpp pal/posix/NetworkInformationImpl.cpp )
Add this OR if(PAL_IMPLEMENTATION STREQUAL "WIN32" OR ${CMAKE_SYSTEM_NAME} STREQUAL "Android")
Regarding including the correct offline storage files, isn't it is already handled here -
https://github.com/microsoft/cpp_client_telemetry/blob/b35fe2d8f5709c9d50dc5a39ffac87768e215ce3/lib/android_build/maesdk/src/main/cpp/CMakeLists.txt#L107-L115
So Room DB files should be included only if build with USE_ROOM. This way, it would be possible to use SQLiteDB in android too if USE_ROOM is not set.
Similar reasoning for HTTP library -
https://github.com/microsoft/cpp_client_telemetry/blob/b35fe2d8f5709c9d50dc5a39ffac87768e215ce3/lib/android_build/maesdk/src/main/cpp/CMakeLists.txt#L117-L121
@ankitkapur - Do you have plan to work on this, or can we close it based on reasoning given in above comments ?