1cmake_minimum_required(VERSION 3.4.1) 2 3include("../protobuf/protobuf.cmake") 4set( MODPB64_DIR "${EXTERNAL_ROOT}/modp_b64") 5 6if (${CMAKE_BUILD_TYPE} STREQUAL "Release") 7set( CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--gc-sections,-s") 8endif (${CMAKE_BUILD_TYPE} STREQUAL "Release") 9 10function(extra_tf_link_options libname) 11 set_link_options(${libname} "tuningfork/version.script") 12endfunction() 13 14protobuf_generate_nano_c( ${CMAKE_CURRENT_SOURCE_DIR}/proto 15 proto/tuningfork.proto 16 proto/tuningfork_clearcut_log.proto 17 proto/example_tuningfork.proto) 18 19include_directories(${PROTOBUF_NANO_SRC_DIR}) 20include_directories( ../../include ) 21include_directories( ../../src/swappy ) 22include_directories( ../common ) 23include_directories( ${MODPB64_DIR}/modp_b64) 24 25include_directories(${PROTO_GENS_DIR}) 26 27set( TUNINGFORK_SRCS 28 clearcut_backend.cpp 29 histogram.cpp 30 prong.cpp 31 uploadthread.cpp 32 tuningfork.cpp 33 tuningfork_c.cpp 34 clearcutserializer.cpp 35 protobuf_util.cpp 36 annotation_util.cpp 37 tuningfork_extra.cpp 38 tuningfork_utils.cpp 39 ${MODPB64_DIR}/modp_b64.cc 40 ${PROTO_GENS_DIR}/nano/tuningfork.pb.c 41 ${PROTO_GENS_DIR}/nano/tuningfork_clearcut_log.pb.c 42 ${PROTO_GENS_DIR}/nano/example_tuningfork.pb.c) 43 44add_library( tuningfork_static 45 STATIC ${TUNINGFORK_SRCS} ${PROTOBUF_NANO_SRCS}) 46set_target_properties( tuningfork_static PROPERTIES 47 COMPILE_OPTIONS "-DPROTOBUF_NANO" ) 48 49add_library( tuningfork 50 SHARED ${TUNINGFORK_SRCS} ${PROTOBUF_NANO_SRCS}) 51set_target_properties( tuningfork PROPERTIES COMPILE_OPTIONS "-DPROTOBUF_NANO" ) 52target_link_libraries( tuningfork 53 android 54 GLESv2 55 log) 56extra_tf_link_options( tuningfork ) 57