From 5610355dd5bc4db4e7d196919bd6dde32e4bf8b9 Mon Sep 17 00:00:00 2001 From: Manasij Sur Roy Date: Fri, 13 May 2016 20:41:15 +0530 Subject: [PATCH] Random Build Error Fix : Made common lib Change-Id: I1c882ed115edef60e57066791d9bb7951bef20b0 Signed-off-by: Manasij Sur Roy --- CMakeLists.txt | 9 ++++++--- client/CMakeLists.txt | 26 +++++++++--------------- common/CMakeLists.txt | 50 ++++++++++++++++++++++++++++++++++++++++++++++ fido_svc_ui/CMakeLists.txt | 11 ++-------- packaging/fido-client.spec | 2 +- server/CMakeLists.txt | 15 ++------------ 6 files changed, 70 insertions(+), 43 deletions(-) create mode 100644 common/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index d434402..5668f87 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,13 +7,16 @@ SET(INCLUDEDIR "\${prefix}/include ") SET(VERSION_MAJOR 0) SET(VERSION "${VERSION_MAJOR}.0.1") -ADD_SUBDIRECTORY(client) +ADD_SUBDIRECTORY(common) ADD_SUBDIRECTORY(fido_svc_ui) ADD_SUBDIRECTORY(server) -ADD_DEPENDENCIES(fido-service fido-ui-service) +ADD_SUBDIRECTORY(client) +ADD_DEPENDENCIES(fido-service fido-client-common) +ADD_DEPENDENCIES(org.tizen.fidosvcui fido-client-common) +ADD_DEPENDENCIES(fido-client fido-client-common) #INSTALL(DIRECTORY lib/fido/asm/ DESTINATION lib/fido/asm/) ADD_SUBDIRECTORY(test/Dummy_ASM_DBUS) -ADD_SUBDIRECTORY(test/shell_tc) +##ADD_SUBDIRECTORY(test/shell_tc) MESSAGE( STATUS "USE_JSON_BUILDER: " ${USE_JSON_BUILDER} ) if(NOT USE_JSON_BUILDER) ADD_SUBDIRECTORY(test/Fido_Sample_RPM) diff --git a/client/CMakeLists.txt b/client/CMakeLists.txt index c732b74..45dd751 100644 --- a/client/CMakeLists.txt +++ b/client/CMakeLists.txt @@ -1,11 +1,9 @@ +SET(CLIENT_LIB fido-client) + SET(CLIENT_SRCS fido_uaf_client.c fido_uaf_authenticator.c - ../common/fido_json_handler.c - ../common/fido_b64_util.c - ../common/fido_tlv_util.c - ../common/fido_uaf_utils.c ) INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include) @@ -37,26 +35,20 @@ if(USE_JSON_BUILDER) add_definitions(-DWITH_JSON_BUILDER) endif() -ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_SOURCE_DIR}/common/fido-stub.c ${CMAKE_SOURCE_DIR}/common/fido-stub.h -WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/common/ -COMMAND gdbus-codegen --interface-prefix org.tizen. --generate-c-code fido-stub ${CMAKE_SOURCE_DIR}/common/dbus_interfaces/fido.xml -COMMENT "Generating FIDO GDBus stubs........................") +ADD_LIBRARY(${CLIENT_LIB} SHARED ${CLIENT_SRCS}) -ADD_LIBRARY(${PROJECT_NAME} SHARED ${CLIENT_SRCS} ${CMAKE_SOURCE_DIR}/common/fido-stub.c) -ADD_DEPENDENCIES(${PROJECT_NAME} ${CMAKE_SOURCE_DIR}/common/fido-stub.h) -ADD_DEPENDENCIES(${PROJECT_NAME} ${CMAKE_SOURCE_DIR}/common/fido-stub.c) -SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES SOVERSION ${VERSION_MAJOR}) -SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES VERSION ${VERSION}) +SET_TARGET_PROPERTIES(${CLIENT_LIB} PROPERTIES SOVERSION ${VERSION_MAJOR}) +SET_TARGET_PROPERTIES(${CLIENT_LIB} PROPERTIES VERSION ${VERSION}) -TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${CLIENT_PKGS_LDFLAGS}) +TARGET_LINK_LIBRARIES(${CLIENT_LIB} ${CLIENT_PKGS_LDFLAGS} fido-client-common) -INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${LIBDIR}) +INSTALL(TARGETS ${CLIENT_LIB} DESTINATION ${LIBDIR}) INSTALL(FILES ${CMAKE_SOURCE_DIR}/include/fido.h DESTINATION include) INSTALL(FILES ${CMAKE_SOURCE_DIR}/include/fido_uaf_authenticator.h DESTINATION include) INSTALL(FILES ${CMAKE_SOURCE_DIR}/include/fido_uaf_client.h DESTINATION include) INSTALL(FILES ${CMAKE_SOURCE_DIR}/common/fido_uaf_types.h DESTINATION include) -CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/client/${PROJECT_NAME}.pc.in ${CMAKE_SOURCE_DIR}/client/${PROJECT_NAME}.pc @ONLY) -INSTALL(FILES ${CMAKE_SOURCE_DIR}/client/${PROJECT_NAME}.pc DESTINATION ${LIBDIR}/pkgconfig) +CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/client/${CLIENT_LIB}.pc.in ${CMAKE_SOURCE_DIR}/client/${CLIENT_LIB}.pc @ONLY) +INSTALL(FILES ${CMAKE_SOURCE_DIR}/client/${CLIENT_LIB}.pc DESTINATION ${LIBDIR}/pkgconfig) diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt new file mode 100644 index 0000000..4770bc2 --- /dev/null +++ b/common/CMakeLists.txt @@ -0,0 +1,50 @@ + +SET(FIDO_COMMON fido-client-common) + +SET(FIDO_COMMON_SRCS + fido_json_handler.c + fido_b64_util.c + fido_tlv_util.c + fido_uaf_utils.c +) + +INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include) +INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/common) + +INCLUDE(FindPkgConfig) +pkg_check_modules(FIDO_COMMON_PKGS REQUIRED + dlog + glib-2.0 + gio-unix-2.0 + gobject-2.0 + capi-base-common + json-glib-1.0 + openssl +) + +FOREACH(flag ${FIDO_COMMON_PKGS_CFLAGS}) + SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}") +ENDFOREACH(flag) + +SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -Wall -Werror") +SET(CMAKE_LDFLAGS "-Wl,-zdefs") + +ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"") +ADD_DEFINITIONS("-DFACTORYFS=\"$ENV{FACTORYFS}\"") +ADD_DEFINITIONS("-DSLP_DEBUG") + +if(USE_JSON_BUILDER) +add_definitions(-DWITH_JSON_BUILDER) +endif() + +ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_SOURCE_DIR}/common/fido-stub.c ${CMAKE_SOURCE_DIR}/common/fido-stub.h +WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/common/ +COMMAND gdbus-codegen --interface-prefix org.tizen. --generate-c-code fido-stub ${CMAKE_SOURCE_DIR}/common/dbus_interfaces/fido.xml +COMMENT "Generating FIDO GDBus stubs........................") + +ADD_LIBRARY(${FIDO_COMMON} STATIC ${FIDO_COMMON_SRCS} ${CMAKE_SOURCE_DIR}/common/fido-stub.c) +ADD_DEPENDENCIES(${FIDO_COMMON} ${CMAKE_SOURCE_DIR}/common/fido-stub.h) +ADD_DEPENDENCIES(${FIDO_COMMON} ${CMAKE_SOURCE_DIR}/common/fido-stub.c) + + +TARGET_LINK_LIBRARIES(${FIDO_COMMON} ${FIDO_COMMON_PKGS_LDFLAGS}) diff --git a/fido_svc_ui/CMakeLists.txt b/fido_svc_ui/CMakeLists.txt index a58e072..c0c312c 100644 --- a/fido_svc_ui/CMakeLists.txt +++ b/fido_svc_ui/CMakeLists.txt @@ -54,16 +54,9 @@ FOREACH(flag ${UI_PKGS_CFLAGS}) SET(EXTRA_CFLGAS "${EXTRA_CFLGAS} ${flag}") ENDFOREACH(flag) -ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_SOURCE_DIR}/common/fido-stub.c ${CMAKE_SOURCE_DIR}/common/fido-stub.h -WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/common/ -COMMAND gdbus-codegen --interface-prefix org.tizen. --generate-c-code fido-stub ${CMAKE_SOURCE_DIR}/common/dbus_interfaces/fido.xml -COMMENT "Generating FIDO GDBus stubs........................") - SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIE ${EXTRA_CFLGAS}") -ADD_EXECUTABLE(${UI_PACKAGE_NAME} ${UI_SRCS} ${CMAKE_SOURCE_DIR}/common/fido-stub.c) -ADD_DEPENDENCIES(${UI_PACKAGE_NAME} ${CMAKE_SOURCE_DIR}/common/fido-stub.h) -ADD_DEPENDENCIES(${UI_PACKAGE_NAME} ${CMAKE_SOURCE_DIR}/common/fido-stub.c) -TARGET_LINK_LIBRARIES(${UI_PACKAGE_NAME} "-pie" ${UI_PKGS_LDFLAGS}) +ADD_EXECUTABLE(${UI_PACKAGE_NAME} ${UI_SRCS}) +TARGET_LINK_LIBRARIES(${UI_PACKAGE_NAME} "-pie" ${UI_PKGS_LDFLAGS} fido-client-common) CONFIGURE_FILE(${UI_PACKAGE_NAME}.xml.in ${UI_PACKAGE_NAME}.xml) if(USE_JSON_BUILDER) diff --git a/packaging/fido-client.spec b/packaging/fido-client.spec index 98a4fe2..2100daf 100644 --- a/packaging/fido-client.spec +++ b/packaging/fido-client.spec @@ -184,7 +184,7 @@ chsmack -a '_' %{_libdir}/fido/asm/ %{_libdir}/*.so %{_libdir}/pkgconfig/*.pc %{_includedir}/*.h -/opt/usr/devel/fido/tc/* +##/opt/usr/devel/fido/tc/* ################################################################################# diff --git a/server/CMakeLists.txt b/server/CMakeLists.txt index 904fb9b..4f78439 100755 --- a/server/CMakeLists.txt +++ b/server/CMakeLists.txt @@ -48,29 +48,18 @@ SET(SERVER_SRCS fido_asm_plugin_manager.c fido_uaf_policy_checker.c fido_selection_ui_adaptor.c - ../common/fido_uaf_utils.c - ../common/fido_json_handler.c - ../common/fido_tlv_util.c fido_app_id_handler.c - ../common/fido_b64_util.c fido_privilege_checker.c ) INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/common) -ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_SOURCE_DIR}/common/fido-stub.c ${CMAKE_SOURCE_DIR}/common/fido-stub.h -WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/common/ -COMMAND gdbus-codegen --interface-prefix org.tizen. --generate-c-code fido-stub ${CMAKE_SOURCE_DIR}/common/dbus_interfaces/fido.xml -COMMENT "Generating FIDO GDBus stubs........................") - SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -Wall -Werror") SET(CMAKE_LDFLAGS "-Wl,-zdefs") -ADD_EXECUTABLE(${SVC_DAEMON} ${SERVER_SRCS} ${CMAKE_SOURCE_DIR}/common/fido-stub.c) -ADD_DEPENDENCIES(${SVC_DAEMON} ${CMAKE_SOURCE_DIR}/common/fido-stub.h) -ADD_DEPENDENCIES(${SVC_DAEMON} ${CMAKE_SOURCE_DIR}/common/fido-stub.c) +ADD_EXECUTABLE(${SVC_DAEMON} ${SERVER_SRCS}) -TARGET_LINK_LIBRARIES(${SVC_DAEMON} ${SERVER_pkgs_LDFLAGS}) +TARGET_LINK_LIBRARIES(${SVC_DAEMON} ${SERVER_pkgs_LDFLAGS} fido-client-common) INSTALL(TARGETS ${SVC_DAEMON} DESTINATION bin) -- 2.7.4