From c94c5fc012de2cb2bba4314b96659c6e497c57ca Mon Sep 17 00:00:00 2001 From: Youngjae Shin Date: Mon, 11 Feb 2019 16:16:48 +0900 Subject: [PATCH] fix build error on building gcov mode Change-Id: I23fcce8899623af086a26d2aa88a92267822a5f4 --- ag-agent/CMakeLists.txt | 18 +++++++++--------- hf-agent/CMakeLists.txt | 18 +++++++++--------- hid-agent/CMakeLists.txt | 18 +++++++++--------- ipsp-agent/CMakeLists.txt | 6 +++--- map-agent/CMakeLists.txt | 20 ++++++++++---------- packaging/bluetooth-agent.spec | 4 +--- pb-agent/CMakeLists.txt | 18 +++++++++--------- unittest/CMakeLists.txt | 2 ++ 8 files changed, 52 insertions(+), 52 deletions(-) diff --git a/ag-agent/CMakeLists.txt b/ag-agent/CMakeLists.txt index c5b357b..94187a5 100644 --- a/ag-agent/CMakeLists.txt +++ b/ag-agent/CMakeLists.txt @@ -40,18 +40,18 @@ ADD_EXECUTABLE(${PROJECT_NAME} ${SRCS}) TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_ag_agent_LDFLAGS}) IF (BUILD_GTESTS) -# -fvisibility option should be "default" to call internal functions -SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fvisibility=default -fPIC -Werror -Wno-deprecated-declarations -fprofile-arcs -ftest-coverage") + # -fvisibility option should be "default" to call internal functions + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fvisibility=default -Werror -Wno-deprecated-declarations") -ADD_LIBRARY(ag-agent SHARED ${SRCS}) -SET_TARGET_PROPERTIES(ag-agent - PROPERTIES - SOVERSION 0.1.0 - CLEAN_DIRECT_OUTPUT 1) + ADD_LIBRARY(ag-agent SHARED ${SRCS}) + SET_TARGET_PROPERTIES(ag-agent + PROPERTIES + SOVERSION 0.1.0 + CLEAN_DIRECT_OUTPUT 1) -TARGET_LINK_LIBRARIES(ag-agent ${pkgs_ag_agent_LDFLAGS} -lgcov) + TARGET_LINK_LIBRARIES(ag-agent ${pkgs_ag_agent_LDFLAGS}) -INSTALL(TARGETS ag-agent DESTINATION lib COMPONENT RuntimeLibraries) + INSTALL(TARGETS ag-agent DESTINATION ${LIB_INSTALL_DIR} COMPONENT RuntimeLibraries) ENDIF (BUILD_GTESTS) INSTALL(TARGETS ${PROJECT_NAME} DESTINATION bin) diff --git a/hf-agent/CMakeLists.txt b/hf-agent/CMakeLists.txt index 48a8211..7b5e4a7 100644 --- a/hf-agent/CMakeLists.txt +++ b/hf-agent/CMakeLists.txt @@ -23,18 +23,18 @@ ADD_EXECUTABLE(${PROJECT_NAME} ${SRCS}) TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_hf_agent_LDFLAGS}) IF (BUILD_GTESTS) -# -fvisibility option should be "default" to call internal functions -SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fvisibility=default -fPIC -Werror -Wno-deprecated-declarations -fprofile-arcs -ftest-coverage") + #-fvisibility option should be "default" to call internal functions + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fvisibility=default -Werror -Wno-deprecated-declarations") -ADD_LIBRARY(hf-agent SHARED ${SRCS}) -SET_TARGET_PROPERTIES(hf-agent - PROPERTIES - SOVERSION 0.1.0 - CLEAN_DIRECT_OUTPUT 1) + ADD_LIBRARY(hf-agent SHARED ${SRCS}) + SET_TARGET_PROPERTIES(hf-agent + PROPERTIES + SOVERSION 0.1.0 + CLEAN_DIRECT_OUTPUT 1) -TARGET_LINK_LIBRARIES(hf-agent ${pkgs_hf_agent_LDFLAGS} -lgcov) + TARGET_LINK_LIBRARIES(hf-agent ${pkgs_hf_agent_LDFLAGS}) -INSTALL(TARGETS hf-agent DESTINATION lib COMPONENT RuntimeLibraries) + INSTALL(TARGETS hf-agent DESTINATION ${LIB_INSTALL_DIR} COMPONENT RuntimeLibraries) ENDIF (BUILD_GTESTS) INSTALL(TARGETS ${PROJECT_NAME} DESTINATION bin) diff --git a/hid-agent/CMakeLists.txt b/hid-agent/CMakeLists.txt index 7e458f9..440e5cb 100644 --- a/hid-agent/CMakeLists.txt +++ b/hid-agent/CMakeLists.txt @@ -21,18 +21,18 @@ ADD_EXECUTABLE(${PROJECT_NAME} ${SRCS}) TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_hid_agent_LDFLAGS}) IF (BUILD_GTESTS) -# -fvisibility option should be "default" to call internal functions -SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fvisibility=default -fPIC -Werror -Wno-deprecated-declarations -fprofile-arcs -ftest-coverage") + # -fvisibility option should be "default" to call internal functions + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fvisibility=default -Werror -Wno-deprecated-declarations") -ADD_LIBRARY(hid-agent SHARED ${SRCS}) -SET_TARGET_PROPERTIES(hid-agent - PROPERTIES - SOVERSION 0.1.0 - CLEAN_DIRECT_OUTPUT 1) + ADD_LIBRARY(hid-agent SHARED ${SRCS}) + SET_TARGET_PROPERTIES(hid-agent + PROPERTIES + SOVERSION 0.1.0 + CLEAN_DIRECT_OUTPUT 1) -TARGET_LINK_LIBRARIES(hid-agent ${pkgs_hid_agent_LDFLAGS} -lgcov) + TARGET_LINK_LIBRARIES(hid-agent ${pkgs_hid_agent_LDFLAGS}) -INSTALL(TARGETS hid-agent DESTINATION lib COMPONENT RuntimeLibraries) + INSTALL(TARGETS hid-agent DESTINATION ${LIB_INSTALL_DIR} COMPONENT RuntimeLibraries) ENDIF (BUILD_GTESTS) INSTALL(TARGETS ${PROJECT_NAME} DESTINATION bin) diff --git a/ipsp-agent/CMakeLists.txt b/ipsp-agent/CMakeLists.txt index 7735666..1943edb 100644 --- a/ipsp-agent/CMakeLists.txt +++ b/ipsp-agent/CMakeLists.txt @@ -41,7 +41,7 @@ TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_ipsp_agent_LDFLAGS} -L${CMAKE_CURRE IF (BUILD_GTESTS) # -fvisibility option should be "default" to call internal functions -SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fvisibility=default -fPIC -Werror -Wno-deprecated-declarations -fprofile-arcs -ftest-coverage") +SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fvisibility=default -Werror -Wno-deprecated-declarations") ADD_LIBRARY(ipsp-agent SHARED ${SRCS}) SET_TARGET_PROPERTIES(ipsp-agent @@ -49,9 +49,9 @@ SET_TARGET_PROPERTIES(ipsp-agent SOVERSION 0.1.0 CLEAN_DIRECT_OUTPUT 1) -TARGET_LINK_LIBRARIES(ipsp-agent ${pkgs_ipsp_agent_LDFLAGS} -lgcov) +TARGET_LINK_LIBRARIES(ipsp-agent ${pkgs_ipsp_agent_LDFLAGS}) -INSTALL(TARGETS ipsp-agent DESTINATION lib COMPONENT RuntimeLibraries) +INSTALL(TARGETS ipsp-agent DESTINATION ${LIB_INSTALL_DIR} COMPONENT RuntimeLibraries) ENDIF (BUILD_GTESTS) INSTALL(TARGETS ${PROJECT_NAME} DESTINATION bin) diff --git a/map-agent/CMakeLists.txt b/map-agent/CMakeLists.txt index c601b53..46b7c2a 100644 --- a/map-agent/CMakeLists.txt +++ b/map-agent/CMakeLists.txt @@ -1,7 +1,7 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.6) PROJECT(bluetooth-map-agent C CXX) -SET(SRCS bluetooth_map_agent.c bluetooth_map_sms.c bluetooth_map_email.c +SET(SRCS bluetooth_map_agent.c bluetooth_map_sms.c bluetooth_map_email.c map_bmessage.c ../include/bluetooth-agent-profile.c) INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) @@ -22,18 +22,18 @@ ADD_EXECUTABLE(${PROJECT_NAME} ${SRCS}) TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_map_agent_LDFLAGS}) IF (BUILD_GTESTS) -# -fvisibility option should be "default" to call internal functions -SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fvisibility=default -fPIC -Werror -Wno-deprecated-declarations -fprofile-arcs -ftest-coverage") + # -fvisibility option should be "default" to call internal functions + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fvisibility=default -Werror -Wno-deprecated-declarations") -ADD_LIBRARY(map-agent SHARED ${SRCS}) -SET_TARGET_PROPERTIES(map-agent - PROPERTIES - SOVERSION 0.1.0 - CLEAN_DIRECT_OUTPUT 1) + ADD_LIBRARY(map-agent SHARED ${SRCS}) + SET_TARGET_PROPERTIES(map-agent + PROPERTIES + SOVERSION 0.1.0 + CLEAN_DIRECT_OUTPUT 1) -TARGET_LINK_LIBRARIES(map-agent ${pkgs_map_agent_LDFLAGS} -lgcov) + TARGET_LINK_LIBRARIES(map-agent ${pkgs_map_agent_LDFLAGS}) -INSTALL(TARGETS map-agent DESTINATION lib COMPONENT RuntimeLibraries) + INSTALL(TARGETS map-agent DESTINATION ${LIB_INSTALL_DIR} COMPONENT RuntimeLibraries) ENDIF (BUILD_GTESTS) INSTALL(TARGETS ${PROJECT_NAME} DESTINATION bin) diff --git a/packaging/bluetooth-agent.spec b/packaging/bluetooth-agent.spec index 51e7dbf..81ec62f 100644 --- a/packaging/bluetooth-agent.spec +++ b/packaging/bluetooth-agent.spec @@ -141,7 +141,7 @@ export LDFLAGS+=" -Wl,--rpath=/usr/lib -Wl,--as-needed -Wl,--unresolved-symbols= export CFLAGS_DEFAULT="$CFLAGS" # Build All (wearalbe/ivi/common/tv/mobile) -cmake . -DCMAKE_INSTALL_PREFIX=/usr \ +%cmake . -DCMAKE_INSTALL_PREFIX=/usr \ -DTIZEN_FEATURE_BT_HFP_AG=1 \ -DBUILD_GTESTS=%{?gcov:1}%{!?gcov:0} \ -DBUILD_GCOV=%{?gcov:1}%{!?gcov:0} @@ -230,6 +230,4 @@ ln -sf %{_libdir}/systemd/system/bluetooth-pbap-agent.service %{_sysconfdir}/sys %manifest %{name}.manifest %{_bindir}/gtest-bluetooth-agent %{_libdir}/lib* -%exclude %{_libdir}/debug/* -%exclude %{_libdir}/debug/.build-id/* %endif diff --git a/pb-agent/CMakeLists.txt b/pb-agent/CMakeLists.txt index f983915..63e0506 100644 --- a/pb-agent/CMakeLists.txt +++ b/pb-agent/CMakeLists.txt @@ -21,18 +21,18 @@ ADD_EXECUTABLE(${PROJECT_NAME} ${SRCS}) TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_pb_agent_LDFLAGS}) IF (BUILD_GTESTS) -# -fvisibility option should be "default" to call internal functions -SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fvisibility=default -fPIC -Werror -Wno-deprecated-declarations -fprofile-arcs -ftest-coverage") + # -fvisibility option should be "default" to call internal functions + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fvisibility=default -Werror -Wno-deprecated-declarations") -ADD_LIBRARY(pb-agent SHARED ${SRCS}) -SET_TARGET_PROPERTIES(pb-agent - PROPERTIES - SOVERSION 0.1.0 - CLEAN_DIRECT_OUTPUT 1) + ADD_LIBRARY(pb-agent SHARED ${SRCS}) + SET_TARGET_PROPERTIES(pb-agent + PROPERTIES + SOVERSION 0.1.0 + CLEAN_DIRECT_OUTPUT 1) -TARGET_LINK_LIBRARIES(pb-agent ${pkgs_pb_agent_LDFLAGS} -lgcov) + TARGET_LINK_LIBRARIES(pb-agent ${pkgs_pb_agent_LDFLAGS}) -INSTALL(TARGETS pb-agent DESTINATION lib COMPONENT RuntimeLibraries) + INSTALL(TARGETS pb-agent DESTINATION ${LIB_INSTALL_DIR} COMPONENT RuntimeLibraries) ENDIF (BUILD_GTESTS) INSTALL(TARGETS ${PROJECT_NAME} DESTINATION bin) diff --git a/unittest/CMakeLists.txt b/unittest/CMakeLists.txt index 9645718..951996a 100644 --- a/unittest/CMakeLists.txt +++ b/unittest/CMakeLists.txt @@ -38,6 +38,8 @@ SET(INCLUDEDIR "/usr/include") INCLUDE(FindPkgConfig) pkg_check_modules(testpkgs REQUIRED dlog glib-2.0 gmock) +INCLUDE_DIRECTORIES(${testpkgs_INCLUDE_DIRS}) + SET(GTEST_TESTS_SOURCES bluetooth-agent_test.cpp ) -- 2.7.4