[Xfce4-commits] [panel-plugins/xfce4-whiskermenu-plugin] 239/473: Minor improvements to build system files.

noreply at xfce.org noreply at xfce.org
Mon Feb 16 23:56:49 CET 2015


This is an automated email from the git hooks/post-receive script.

gottcode pushed a commit to branch master
in repository panel-plugins/xfce4-whiskermenu-plugin.

commit 3a6c14adb92619bf76d4ffe01b07f29e987b4ade
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 ++++++++----
 panel-plugin/CMakeLists.txt |   32 +++++++++++++++++++-------------
 3 files changed, 29 insertions(+), 18 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index e548db9..c0dfc49 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -19,9 +19,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/panel-plugin/CMakeLists.txt b/panel-plugin/CMakeLists.txt
index 7e2b3b8..c6af58b 100644
--- a/panel-plugin/CMakeLists.txt
+++ b/panel-plugin/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")
@@ -42,9 +42,6 @@ add_definitions(
 	-DDATADIR="${CMAKE_INSTALL_FULL_DATADIR}"
 	-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}
@@ -52,12 +49,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
@@ -93,7 +99,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