[Xfce4-commits] [panel-plugins/xfce4-whiskermenu-plugin] 17/23: Minor improvements to build system files.
noreply at xfce.org
noreply at xfce.org
Sat Aug 20 18:34:15 CEST 2016
This is an automated email from the git hooks/post-receive script.
gottcode pushed a commit to annotated tag v1.2.1
in repository panel-plugins/xfce4-whiskermenu-plugin.
commit ee8ff57983c02f85524e00bb4fd080479cb80135
Author: Graeme Gott <graeme at gottcode.org>
Date: Fri Nov 15 13:11:13 2013 -0500
Minor improvements to build system files.
Allow disabling visibility.
Remove GTK type checks in release builds.
Check that all symbols are resolved in development builds.
---
CMakeLists.txt | 3 ++-
INSTALL | 12 ++++++++----
src/CMakeLists.txt | 32 +++++++++++++++++++-------------
3 files changed, 29 insertions(+), 18 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 055101d..a0feaf7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -22,9 +22,10 @@ if(${whiskermenu_version_tag} MATCHES "git")
endif()
# options
-option(ENABLE_WERROR "Enable -Werror flag for development" OFF)
+option(ENABLE_VISIBILITY "Enable ELF visibility attributes" ON)
option(ENABLE_AS_NEEDED "Enable -Wl,--as-needed for the linker" ON)
option(ENABLE_LINKER_OPTIMIZED_HASH_TABLES "Enable -Wl,-O1 for the linker" ON)
+option(ENABLE_DEVELOPER_MODE "Enable strict checks to help with development" OFF)
include(GNUInstallDirs)
diff --git a/INSTALL b/INSTALL
index 569d691..2a3cf62 100644
--- a/INSTALL
+++ b/INSTALL
@@ -72,11 +72,15 @@ More CMake Options
Choose where manual pages are installed
(defaults to $CMAKE_INSTALL_DATADIR/man).
--ENABLE_WERROR=[OFF]
- Make compiler treat warnings as errors for development.
+-DENABLE_VISIBILITY=[ON]
+ Make compiler hide local symbols in plugin.
--ENABLE_AS_NEEDED=[ON]
+-DENABLE_AS_NEEDED=[ON]
Pass -Wl,--as-needed to the linker to reduce symbols in plugin.
--ENABLE_LINKER_OPTIMIZED_HASH_TABLES=[ON]
+-DENABLE_LINKER_OPTIMIZED_HASH_TABLES=[ON]
Pass -Wl,-O1 to the linker to optimize hash tables in plugin.
+
+-DENABLE_DEVELOPER_MODE=[OFF]
+ Enable strict checks which are not needed by users of the plugin
+ but are useful for development.
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 14e966d..4431e5d 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -1,9 +1,9 @@
set(WHISKERMENU_FLAGS "-Wall -Wextra")
-if(ENABLE_WERROR)
- set(WHISKERMENU_FLAGS "${WHISKERMENU_FLAGS} -Werror")
-endif()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${WHISKERMENU_FLAGS}")
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden ${WHISKERMENU_FLAGS}")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${WHISKERMENU_FLAGS}")
+if(ENABLE_VISIBILITY)
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden")
+endif()
if(ENABLE_AS_NEEDED)
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,--as-needed")
@@ -40,9 +40,6 @@ add_definitions(
-DPACKAGE_LOCALE_DIR="${CMAKE_INSTALL_FULL_LOCALEDIR}"
-DG_LOG_DOMAIN="whiskermenu"
-DGSEAL_ENABLE
- -DGDK_DISABLE_SINGLE_INCLUDES
- -DGDK_PIXBUF_DISABLE_SINGLE_INCLUDES
- -DGTK_DISABLE_SINGLE_INCLUDES
-DGTK_MULTIHEAD_SAFE
${exo_CFLAGS_OTHER}
${garcon_CFLAGS_OTHER}
@@ -50,12 +47,21 @@ add_definitions(
${libxfce4ui_CFLAGS_OTHER}
${libxfce4util_CFLAGS_OTHER})
-if(${libxfce4panel_VERSION} VERSION_GREATER "4.9")
+if(ENABLE_DEVELOPER_MODE)
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror")
+ set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,-z,defs")
+
+ if(${libxfce4panel_VERSION} VERSION_GREATER "4.9")
+ add_definitions(
+ -DG_DISABLE_DEPRECATED
+ -DGDK_DISABLE_DEPRECATED
+ -DGDK_PIXBUF_DISABLE_DEPRECATED
+ -DGTK_DISABLE_DEPRECATED)
+ endif()
add_definitions(
- -DG_DISABLE_DEPRECATED
- -DGDK_DISABLE_DEPRECATED
- -DGDK_PIXBUF_DISABLE_DEPRECATED
- -DGTK_DISABLE_DEPRECATED)
+ -DGDK_DISABLE_SINGLE_INCLUDES
+ -DGDK_PIXBUF_DISABLE_SINGLE_INCLUDES
+ -DGTK_DISABLE_SINGLE_INCLUDES)
endif()
add_library(whiskermenu MODULE
@@ -88,7 +94,7 @@ target_link_libraries(whiskermenu
string(TOLOWER "${CMAKE_BUILD_TYPE}" CMAKE_BUILD_TYPE_TOLOWER)
if(CMAKE_BUILD_TYPE_TOLOWER MATCHES "release|minsizerel")
- add_definitions(-DG_DISABLE_ASSERT)
+ add_definitions(-DNDEBUG -DG_DISABLE_CAST_CHECKS -DG_DISABLE_ASSERT)
add_custom_command(TARGET whiskermenu
POST_BUILD COMMAND ${CMAKE_STRIP} $<TARGET_FILE:whiskermenu>)
endif()
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list