on xenial help sign in
Need to set -fvisibility=hidden only for executables, so shared library can export symbols to be linked against
5e0763aGerry Boland
CMakeLists.txt−2
@@ -69,8 +69,6 @@ if(SHELL_PLUGINDIR STREQUAL "")
69 message(FATAL_ERROR "Could not determine plugin import dir.")
69 message(FATAL_ERROR "Could not determine plugin import dir.")
70endif()
70endif()
71
71
72−set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden")
73−
74set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -fno-permissive -pedantic -Wall -Wextra")
72set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -fno-permissive -pedantic -Wall -Wextra")
75
73
76if ("${CMAKE_BUILD_TYPE}" STREQUAL "release" OR "${CMAKE_BUILD_TYPE}" STREQUAL "relwithdebinfo")
74if ("${CMAKE_BUILD_TYPE}" STREQUAL "release" OR "${CMAKE_BUILD_TYPE}" STREQUAL "relwithdebinfo")
plugins/CMakeLists.txt+2
@@ -11,6 +11,8 @@ macro(add_unity8_plugin PLUGIN VERSION PATH)
11 export_qmlplugin(${PLUGIN} ${VERSION} ${PATH} DESTINATION ${SHELL_INSTALL_QML} ${ARGN})
11 export_qmlplugin(${PLUGIN} ${VERSION} ${PATH} DESTINATION ${SHELL_INSTALL_QML} ${ARGN})
12endmacro()
12endmacro()
13
13
14+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden")
15+
14add_subdirectory(AccountsService)
16add_subdirectory(AccountsService)
15add_subdirectory(HudClient)
17add_subdirectory(HudClient)
16add_subdirectory(LightDM)
18add_subdirectory(LightDM)
src/Dash/CMakeLists.txt+2
@@ -8,6 +8,8 @@ add_executable(unity8-dash ${DASH_SRCS})
8
8
9qt5_use_modules(unity8-dash Gui Qml Quick Test)
9qt5_use_modules(unity8-dash Gui Qml Quick Test)
10
10
11+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden")
12+
11# install binaries
13# install binaries
12install(TARGETS ${DASH_APP}
14install(TARGETS ${DASH_APP}
13 RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
15 RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
src/Panel/CMakeLists.txt+2
@@ -1 +1,3 @@
1add_subdirectory(Indicators)
1add_subdirectory(Indicators)
2+
3+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden")
src/libunity8-private/CMakeLists.txt+13−3
@@ -1,15 +1,25 @@
1set(LIB_NAME "unity8-private")
1set(LIB_NAME "unity8-private")
2+set(SOVERSION 0)
3+set(VERSION ${SOVERSION}.0.0)
4+
5+project(lib${LIB_NAME})
2
6
3set(lib${LIB_NAME}_SRCS
7set(lib${LIB_NAME}_SRCS
4 abstractdbusservicemonitor.cpp
8 abstractdbusservicemonitor.cpp
5−)
9+ )
6
10
7add_library(${LIB_NAME} SHARED
11add_library(${LIB_NAME} SHARED
8 ${lib${LIB_NAME}_SRCS}
12 ${lib${LIB_NAME}_SRCS}
9−)
13+ )
14+
15+set_target_properties(${LIB_NAME} PROPERTIES
16+ VERSION ${VERSION}
17+ SOVERSION ${SOVERSION}
18+ )
19+
10qt5_use_modules(${LIB_NAME} DBus)
20qt5_use_modules(${LIB_NAME} DBus)
11
21
12# install library
22# install library
13install(TARGETS ${LIB_NAME}
23install(TARGETS ${LIB_NAME}
14 LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
24 LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
15−)
25+ )