Switch on -fvisibility=hidden to remove non-needed symbols from resulting binary
and LTO to reduce size.
libtpk-installer.so is reduced by 40%
Change-Id: I8c75de21d6b4052835f997ebb3382174416f4f0c
Signed-off-by: Slava Barinov <v.barinov@samsung.com>
Signed-off-by: jongmyeongko <jongmyeong.ko@samsung.com>
ENDIF(NOT CMAKE_BUILD_TYPE)
# Compiler flags
-SET(EXTRA_FLAGS "-Wall -Wextra")
+SET(EXTRA_FLAGS "-fvisibility=hidden -flto -Wall -Wextra")
SET(CMAKE_C_FLAGS_PROFILING "-O2 ${EXTRA_FLAGS}")
SET(CMAKE_CXX_FLAGS_PROFILING "-O2 -std=c++11 ${EXTRA_FLAGS}")
SET(CMAKE_C_FLAGS_DEBUG "-O0 -g ${EXTRA_FLAGS}")
SET(TARGET_MANIFEST_TEST "manifest-test")
ADD_DEFINITIONS("-DPROJECT_TAG=\"TPK_BACKEND\"")
+ADD_DEFINITIONS("-DTPK_BACKEND_EXPORT_API=__attribute__((visibility(\"default\")))")
SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules/")
INCLUDE(FindPkgConfig)
#ifndef TPK_STEP_FILESYSTEM_STEP_CREATE_SYMBOLIC_LINK_H_
#define TPK_STEP_FILESYSTEM_STEP_CREATE_SYMBOLIC_LINK_H_
+#ifndef TPK_BACKEND_EXPORT_API
+#define TPK_BACKEND_EXPORT_API
+#endif
+
#include <manifest_parser/utils/logging.h>
#include <common/app_installer.h>
namespace tpk {
namespace filesystem {
-class StepCreateSymbolicLink : public common_installer::Step {
+class TPK_BACKEND_EXPORT_API StepCreateSymbolicLink
+ : public common_installer::Step {
public:
using Step::Step;
Status process() override;
#ifndef TPK_STEP_FILESYSTEM_STEP_TPK_PATCH_ICONS_H_
#define TPK_STEP_FILESYSTEM_STEP_TPK_PATCH_ICONS_H_
+#ifndef TPK_BACKEND_EXPORT_API
+#define TPK_BACKEND_EXPORT_API
+#endif
+
#include <boost/filesystem/path.hpp>
#include <common/step/step.h>
* Fixes location of icons for tpk apps if icons are not located in
* "shared/res/" directory.
*/
-class StepTpkPatchIcons : public common_installer::Step {
+class TPK_BACKEND_EXPORT_API StepTpkPatchIcons : public common_installer::Step {
public:
using Step::Step;
#ifndef TPK_STEP_FILESYSTEM_STEP_TPK_PREPARE_PACKAGE_DIRECTORY_H_
#define TPK_STEP_FILESYSTEM_STEP_TPK_PREPARE_PACKAGE_DIRECTORY_H_
+#ifndef TPK_BACKEND_EXPORT_API
+#define TPK_BACKEND_EXPORT_API
+#endif
+
#include <manifest_parser/utils/logging.h>
#include <boost/filesystem/path.hpp>
* - signature*.xml
* - res/
*/
-class StepTpkPreparePackageDirectory : public common_installer::Step {
+class TPK_BACKEND_EXPORT_API StepTpkPreparePackageDirectory
+ : public common_installer::Step {
public:
using Step::Step;
#ifndef TPK_STEP_FILESYSTEM_STEP_TPK_UPDATE_PACKAGE_DIRECTORY_H_
#define TPK_STEP_FILESYSTEM_STEP_TPK_UPDATE_PACKAGE_DIRECTORY_H_
+#ifndef TPK_BACKEND_EXPORT_API
+#define TPK_BACKEND_EXPORT_API
+#endif
+
#include <boost/filesystem/path.hpp>
#include <manifest_parser/utils/logging.h>
* This step will, additionally to base step actions, ,aintain backup
* of directories from point 1) for operation rollback scenario.
*/
-class StepTpkUpdatePackageDirectory : public StepTpkPreparePackageDirectory {
+class TPK_BACKEND_EXPORT_API StepTpkUpdatePackageDirectory
+ : public StepTpkPreparePackageDirectory {
public:
using StepTpkPreparePackageDirectory::StepTpkPreparePackageDirectory;
* \brief This step check background category value and modify it depending on
* required version, cert level, background support, and value itself
*/
-class StepCheckTpkBackgroundCategory :
- public common_installer::security::StepCheckBackgroundCategory {
+class StepCheckTpkBackgroundCategory
+ : public common_installer::security::StepCheckBackgroundCategory {
public:
explicit StepCheckTpkBackgroundCategory(
common_installer::InstallerContext* context);
#ifndef TPK_TPK_APP_QUERY_INTERFACE_H_
#define TPK_TPK_APP_QUERY_INTERFACE_H_
+#ifndef TPK_BACKEND_EXPORT_API
+#define TPK_BACKEND_EXPORT_API
+#endif
+
#include <common/app_query_interface.h>
namespace tpk {
-class TpkAppQueryInterface : public common_installer::AppQueryInterface {
+class TPK_BACKEND_EXPORT_API TpkAppQueryInterface
+ : public common_installer::AppQueryInterface {
public:
bool IsAppInstalledByArgv(int argc, char** argv) override;
};
#ifndef TPK_TPK_INSTALLER_H_
#define TPK_TPK_INSTALLER_H_
+#ifndef TPK_BACKEND_EXPORT_API
+#define TPK_BACKEND_EXPORT_API
+#endif
+
#include <common/app_installer.h>
#include <common/pkgmgr_interface.h>
#include <manifest_parser/utils/logging.h>
* packages. Pkgmgr request is parsed within and sequence of steps is built to
* be run.
*/
-class TpkInstaller : public common_installer::AppInstaller {
+class TPK_BACKEND_EXPORT_API TpkInstaller
+ : public common_installer::AppInstaller {
public:
explicit TpkInstaller(common_installer::PkgMgrPtr pkgmgr);
~TpkInstaller();