From f62b7d74d3cbed0130c5d57c00802fb08ff9dc9e Mon Sep 17 00:00:00 2001 From: Armin Novak Date: Wed, 18 Sep 2013 12:50:10 +0200 Subject: [PATCH] Added profile option for android to build system. --- CMakeLists.txt | 20 ++++++++++++++++++++ libfreerdp/CMakeLists.txt | 5 +++-- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f9ce8252f..e53158e3e 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -274,7 +274,17 @@ if(ANDROID) else() message(STATUS "FREERDP_ANDROID_EXTERNAL_SSL_PATH not set! - Needs to be set if openssl is not found in the android NDK (which usually isn't)") endif() + if(WITH_PROFILER) + if (NOT FREERDP_ANDROID_EXTERNAL_PROFILER_PATH) + if(IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/external/android-ndk-profiler") + set(FREERDP_ANDROID_EXTERNAL_PROFILER_PATH + "${CMAKE_CURRENT_SOURCE_DIR}/external/android-ndk-profiler") + else() + message(STATUS "FREERDP_ANDROID_EXTERNAL_PROFILER_PATH not set!") + endif() + endif() endif() +endif() set(CMAKE_FIND_ROOT_PATH ${CMAKE_FIND_ROOT_PATH} ${FREERDP_ANDROID_EXTERNAL_SSL_PATH}) set(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/client/Android/FreeRDPCore/libs/${ANDROID_ABI}) CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/scripts/regenerate_jni_headers.sh.cmake ${CMAKE_CURRENT_SOURCE_DIR}/scripts/regenerate_jni_headers.sh @ONLY) @@ -448,6 +458,16 @@ set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE) set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) set(CMAKE_INSTALL_RPATH "\$ORIGIN/../${CMAKE_INSTALL_LIBDIR}:\$ORIGIN/..") +# Android profiling +if(ANDROID) + if(WITH_PROFILER) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pg") + set(PROFILER_LIBRARIES + "${FREERDP_ANDROID_EXTERNAL_PROFILER_PATH}/obj/local/${ANDROID_ABI}/libandroid-ndk-profiler.a") + include_directories("${FREERDP_ANDROID_EXTERNAL_PROFILER_PATH}") + endif() +endif() + # Unit Tests include(CTest) diff --git a/libfreerdp/CMakeLists.txt b/libfreerdp/CMakeLists.txt index 3a167bcf5..1dbdb2ce1 100644 --- a/libfreerdp/CMakeLists.txt +++ b/libfreerdp/CMakeLists.txt @@ -52,12 +52,13 @@ if(MONOLITHIC_BUILD) set(${MODULE_PREFIX}_OBJECTS ${${MODULE_PREFIX}_OBJECTS} "$") endforeach() - add_library(${MODULE_NAME} dummy.c ${${MODULE_PREFIX}_OBJECTS}) + add_library(${MODULE_NAME} dummy.c + ${${MODULE_PREFIX}_OBJECTS}) set_target_properties(${MODULE_NAME} PROPERTIES LINKER_LANGUAGE C) set_target_properties(${MODULE_NAME} PROPERTIES VERSION ${FREERDP_VERSION} SOVERSION ${FREERDP_API_VERSION} PREFIX "lib") - target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS}) + target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS} ${PROFILER_LIBRARIES}) install(TARGETS ${MODULE_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT libraries)