Home | History | Annotate | Download | only in tuningfork
      1 cmake_minimum_required(VERSION 3.4.1)
      2 
      3 include("../protobuf/protobuf.cmake")
      4 set( MODPB64_DIR "${EXTERNAL_ROOT}/modp_b64")
      5 
      6 if (${CMAKE_BUILD_TYPE} STREQUAL "Release")
      7 set( CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--gc-sections,-s")
      8 endif (${CMAKE_BUILD_TYPE} STREQUAL "Release")
      9 
     10 function(extra_tf_link_options libname)
     11   set_link_options(${libname} "tuningfork/version.script")
     12 endfunction()
     13 
     14 protobuf_generate_nano_c( ${CMAKE_CURRENT_SOURCE_DIR}/proto
     15   proto/tuningfork.proto
     16   proto/tuningfork_clearcut_log.proto
     17   proto/example_tuningfork.proto)
     18 
     19 include_directories(${PROTOBUF_NANO_SRC_DIR})
     20 include_directories( ../../include )
     21 include_directories( ../../src/swappy )
     22 include_directories( ../common )
     23 include_directories( ${MODPB64_DIR}/modp_b64)
     24 
     25 include_directories(${PROTO_GENS_DIR})
     26 
     27 set( 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 
     44 add_library( tuningfork_static
     45   STATIC ${TUNINGFORK_SRCS} ${PROTOBUF_NANO_SRCS})
     46 set_target_properties( tuningfork_static PROPERTIES
     47   COMPILE_OPTIONS "-DPROTOBUF_NANO" )
     48 
     49 add_library( tuningfork
     50   SHARED ${TUNINGFORK_SRCS} ${PROTOBUF_NANO_SRCS})
     51 set_target_properties( tuningfork PROPERTIES COMPILE_OPTIONS "-DPROTOBUF_NANO" )
     52 target_link_libraries( tuningfork
     53   android
     54   GLESv2
     55   log)
     56 extra_tf_link_options( tuningfork )
     57