)
SET (${this_target}_SOURCE_FILES
- src/system/FSys_SettingService.cpp
- src/runtime/FSys_RuntimeInfoStub.cpp
src/FApp_PackageManagerStub.cpp
src/FUi_UiManagerStub.cpp
src/CommonService.cpp
src/CommonServiceEntry.cpp
- src/FSys_SystemServiceIpcEventForAsync.cpp
)
-#ADD_SUBDIRECTORY(src/system)
+ADD_SUBDIRECTORY(src/system)
## SET EXTRA COMPILER FLAGS
SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -fPIE -Wall -pthread -g3" )
SET(CMAKE_INSTALL_RPATH "/usr/lib/osp-server")
SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH FALSE)
-## Create Library
+## Create Executable
ADD_EXECUTABLE (${this_target} ${${this_target}_SOURCE_FILES})
+## Create Shared Library
+SET(STATIC_LIBS system_service)
+
+SET_TARGET_PROPERTIES(${this_target} PROPERTIES LINK_INTERFACE_LIBRARIES "")
+
+ADD_DEPENDENCIES(${this_target} ${STATIC_LIBS})
+
+MACRO(OSP_ADD_OBJS_IN_ARCHIVE archives)
+ SET(LINK_OBJECTS_IN_ARCHIVE)
+ FOREACH(archive ${ARGV})
+ SET(LINK_OBJECTS_IN_ARCHIVE "${LINK_OBJECTS_IN_ARCHIVE} -l${archive}")
+ ENDFOREACH(archive)
+ SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--whole-archive ${LINK_OBJECTS_IN_ARCHIVE} -Wl,-no-whole-archive")
+ENDMACRO(OSP_ADD_OBJS_IN_ARCHIVE)
+
+OSP_ADD_OBJS_IN_ARCHIVE(${STATIC_LIBS})
+
+SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined -Wl,--as-needed")
+
+TARGET_LINK_LIBRARIES( ${this_target} ${STATIC_LIBS})
+
TARGET_LINK_LIBRARIES(${this_target} -Xlinker --no-undefined -Xlinker --as-needed -pie)
TARGET_LINK_LIBRARIES(${this_target} "-L/usr/lib/osp -losp-appfw -lchromium")
TARGET_LINK_LIBRARIES(${this_target} "-L/usr/lib/osp -losp-uifw" )