From: Seungyoun Ju Date: Sat, 16 Feb 2013 04:53:17 +0000 (+0900) Subject: Wrong linker flags are used X-Git-Tag: submit/tizen_2.1/20130424.230634~1^2~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7634241bf13cc258c4aa90808d18e395e9bc6500;p=platform%2Fcore%2Fapi%2Ftethering.git Wrong linker flags are used - Issues EXE Linker flags are defined and symbol visibility option is set wrongly - Fix description Shared library linker flags are defined properly. Symbol visibility option is moved to cflags. Change-Id: Id0636819b7eee80b01172069b185d1f6046d7554 --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 75bd74e..474670b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,13 +11,17 @@ INCLUDE_DIRECTORIES(${INC_DIR}) SET(dependents "dlog glib-2.0 capi-base-common dbus-glib-1 vconf") +IF("${CMAKE_BUILD_TYPE}" STREQUAL "") + SET(CMAKE_BUILD_TYPE "Release") +ENDIF("${CMAKE_BUILD_TYPE}" STREQUAL "") + INCLUDE(FindPkgConfig) pkg_check_modules(${fw_name} REQUIRED ${dependents}) FOREACH(flag ${${fw_name}_CFLAGS}) SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}") ENDFOREACH(flag) -SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIC -Wall -Werror") +SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIC -Wall -Werror -fvisibility=hidden") SET(CMAKE_C_FLAGS_DEBUG "-O0 -g") IF("${ARCH}" STREQUAL "arm") @@ -27,7 +31,7 @@ ENDIF("${ARCH}" STREQUAL "arm") ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"") ADD_DEFINITIONS("-DTIZEN_DEBUG") -SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--rpath=%{_libdir} -fvisibility=hidden") +SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--as-needed -Wl,--rpath=%{_libdir}") FIND_PROGRAM(MARSHALTOOL NAMES glib-genmarshal) EXEC_PROGRAM("${MARSHALTOOL}" ARGS "--prefix=marshal ${INC_DIR}/marshal.list --header > ${INC_DIR}/marshal.h") diff --git a/src/tethering.c b/src/tethering.c index d75692e..a4c8284 100644 --- a/src/tethering.c +++ b/src/tethering.c @@ -1865,7 +1865,7 @@ API int tethering_wifi_get_security_type(tethering_h tethering, tethering_wifi_s * @retval #TETHERING_ERROR_INVALID_PARAMETER Invalid parameter * @retval #TETHERING_ERROR_OUT_OF_MEMORY Out of memory */ -int tethering_wifi_set_ssid(tethering_h tethering, const char *ssid) +API int tethering_wifi_set_ssid(tethering_h tethering, const char *ssid) { _retvm_if(tethering == NULL, TETHERING_ERROR_INVALID_PARAMETER, "parameter(tethering) is NULL\n"); diff --git a/src/tethering_client.c b/src/tethering_client.c index 3dca574..64cd78b 100644 --- a/src/tethering_client.c +++ b/src/tethering_client.c @@ -18,7 +18,7 @@ #include #include "tethering_private.h" -int tethering_client_clone(tethering_client_h *dest, tethering_client_h origin) +API int tethering_client_clone(tethering_client_h *dest, tethering_client_h origin) { _retvm_if(dest == NULL, TETHERING_ERROR_INVALID_PARAMETER, "Parameter(dest) is NULL\n"); @@ -39,7 +39,7 @@ int tethering_client_clone(tethering_client_h *dest, tethering_client_h origin) return TETHERING_ERROR_NONE; } -int tethering_client_destroy(tethering_client_h client) +API int tethering_client_destroy(tethering_client_h client) { _retvm_if(client == NULL, TETHERING_ERROR_INVALID_PARAMETER, "Parameter(client) is NULL\n"); @@ -49,7 +49,7 @@ int tethering_client_destroy(tethering_client_h client) return TETHERING_ERROR_NONE; } -int tethering_client_get_tethering_type(tethering_client_h client, tethering_type_e *type) +API int tethering_client_get_tethering_type(tethering_client_h client, tethering_type_e *type) { _retvm_if(client == NULL, TETHERING_ERROR_INVALID_PARAMETER, "Parameter(client) is NULL\n"); @@ -63,7 +63,7 @@ int tethering_client_get_tethering_type(tethering_client_h client, tethering_typ return TETHERING_ERROR_NONE; } -int tethering_client_get_name(tethering_client_h client, char **name) +API int tethering_client_get_name(tethering_client_h client, char **name) { _retvm_if(client == NULL, TETHERING_ERROR_INVALID_PARAMETER, "Parameter(client) is NULL\n"); @@ -81,7 +81,7 @@ int tethering_client_get_name(tethering_client_h client, char **name) return TETHERING_ERROR_NONE; } -int tethering_client_get_ip_address(tethering_client_h client, tethering_address_family_e address_family, char **ip_address) +API int tethering_client_get_ip_address(tethering_client_h client, tethering_address_family_e address_family, char **ip_address) { _retvm_if(client == NULL, TETHERING_ERROR_INVALID_PARAMETER, "Parameter(client) is NULL\n"); @@ -99,7 +99,7 @@ int tethering_client_get_ip_address(tethering_client_h client, tethering_address return TETHERING_ERROR_NONE; } -int tethering_client_get_mac_address(tethering_client_h client, char **mac_address) +API int tethering_client_get_mac_address(tethering_client_h client, char **mac_address) { _retvm_if(client == NULL, TETHERING_ERROR_INVALID_PARAMETER, "Parameter(client) is NULL\n");