aboutsummaryrefslogtreecommitdiffstats
path: root/libparc
diff options
context:
space:
mode:
Diffstat (limited to 'libparc')
-rw-r--r--libparc/CMakeLists.txt4
-rw-r--r--libparc/parc/CMakeLists.txt2
-rw-r--r--libparc/parc/algol/parc_FileOutputStream.c8
3 files changed, 11 insertions, 3 deletions
diff --git a/libparc/CMakeLists.txt b/libparc/CMakeLists.txt
index 4d42ae0d..4950bc71 100644
--- a/libparc/CMakeLists.txt
+++ b/libparc/CMakeLists.txt
@@ -22,7 +22,7 @@ include(version)
include(detectCacheSize)
include(CheckRealloc)
-if(ANDROID_API)
+if(${CMAKE_SYSTEM_NAME} STREQUAL "Android")
message("############ Detected cross compile for $ENV{CMAKE_SYSTEM_NAME}")
message("############ This build will not include doxygen, tools, or tests")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${ANDROID_C_FLAGS} -Wall")
@@ -108,7 +108,7 @@ add_custom_target(${PROJECT_NAME}_cleanup_profiling_data
"find" "." "-name" "*.gcda" "-delete"
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Cleanup previous profiling data.")
-if (ANDROID_API)
+if(${CMAKE_SYSTEM_NAME} STREQUAL "Android")
macro(AddTest testFile)
message("Android build: Skipping test ${ARGV0}")
endmacro(AddTest)
diff --git a/libparc/parc/CMakeLists.txt b/libparc/parc/CMakeLists.txt
index df582a35..62c81b6e 100644
--- a/libparc/parc/CMakeLists.txt
+++ b/libparc/parc/CMakeLists.txt
@@ -392,7 +392,7 @@ if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang" OR COMPILE_FOR_IOS)
set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS} -undefined dynamic_lookup")
message( "-- Set \"-undefined dynamic_lookup\" for shared libraries")
endif()
-if(COMPILE_FOR_IOS OR ANDROID_API)
+if(COMPILE_FOR_IOS OR ${CMAKE_SYSTEM_NAME} STREQUAL "Android")
add_library(parc STATIC ${LIBPARC_SOURCE_FILES} ${LIBEVENT_LIBRARIES} ${OPENSSL_LIBRARIES})
target_link_libraries(parc ${LIBEVENT_LIBRARIES})
target_link_libraries(parc ${OPENSSL_LIBRARIES})
diff --git a/libparc/parc/algol/parc_FileOutputStream.c b/libparc/parc/algol/parc_FileOutputStream.c
index c119e67f..b11280aa 100644
--- a/libparc/parc/algol/parc_FileOutputStream.c
+++ b/libparc/parc/algol/parc_FileOutputStream.c
@@ -17,6 +17,10 @@
#include <unistd.h>
#endif
+#ifdef __ANDROID__
+#include <android/log.h>
+#endif
+
#include <config.h>
#include <stdio.h>
@@ -74,10 +78,14 @@ parcFileOutputStream_Write(PARCFileOutputStream *outputStream, PARCBuffer *buffe
size_t remaining = parcBuffer_Remaining(buffer);
size_t chunkSize = remaining > maximumChunkSize ? maximumChunkSize : remaining;
void *buf = parcBuffer_Overlay(buffer, chunkSize);
+#ifdef __ANDROID__
+ __android_log_print(ANDROID_LOG_INFO,"PARC", "%.*s", (int)chunkSize, buf);
+#else
ssize_t nwritten = write(outputStream->fd, buf, (unsigned int)chunkSize);
if (nwritten == -1) {
break;
}
+#endif
}
return parcBuffer_HasRemaining(buffer) == false;