From 48039fb663384315f486bf7fe216f339de786287 Mon Sep 17 00:00:00 2001 From: Alf Gaida Date: Tue, 6 Dec 2016 22:27:24 +0100 Subject: [PATCH] Cherry-picking upstream version 0.3.0. * Fixed VCS-Fields to branch debian/sid --- CHANGELOG | 24 ++++- CMakeLists.txt | 6 +- cmake/find-modules/FindFm.cmake | 80 ++++++++++++++ cmake/find-modules/FindGLIB.cmake | 126 +++++++++++++++++++++++ cmake/find-modules/FindMenuCache.cmake | 88 ++++++++++++++++ cmake/find-modules/FindUDev.cmake | 65 ++++++++++++ cmake/find-modules/FindXCB.cmake | 53 ++++++++++ cmake/modules/LXQtCompilerSettings.cmake | 48 ++++++++- debian/changelog | 7 ++ debian/control | 4 +- 10 files changed, 493 insertions(+), 8 deletions(-) create mode 100644 cmake/find-modules/FindFm.cmake create mode 100644 cmake/find-modules/FindGLIB.cmake create mode 100644 cmake/find-modules/FindMenuCache.cmake create mode 100644 cmake/find-modules/FindUDev.cmake create mode 100644 cmake/find-modules/FindXCB.cmake diff --git a/CHANGELOG b/CHANGELOG index e02d385..63ae733 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,7 +1,29 @@ -lxqt-build-tools-0.2.0 / 2016-10-30 +lxqt-build-tools-0.3.0 / 2016-12-06 =================================== + * Adds an FindXCB CMake module + * FindUDev: Add VERSION_STRING support + * FindUDev: Set REQUIRED_VARS + * FindUdev: Feed pkg_modules_modules results to find_library/path + * FindUDev: Adds Feature Summary + * Adds FindUDev module + * Enables colored diagnostics for CLang/Ninja combination + * Disable link-time optimization for clang++/llvm since after some testing it breaks QObject signal/slot sometimes. * Remove trailing spaces. + * Use different link-time optimization compiler options for gcc and clang and move -Bsymbolic flags to linker flags. + * Add more linker options to turn on linker-time optimizations for gcc & clang. + * Set CMAKE_BUILD_TYPE to Release by default if it's value is not set. + * FindGLIB: Improve gio-unix handling + * Adds a FindGLIB CMake module + * Adds a FindMenuCache CMake module + * Adds a FindFm CMake module + * move project name to top + * Fixes the name of package config file name in superbuild mode + +0.2.0 / 2016-10-30 +================== + + * Release 0.2.0: Update changelog * Bump minor to 2 (#7) * Added Qt5Core to README.md (#6) * Adds an LXQtConfigVars module diff --git a/CMakeLists.txt b/CMakeLists.txt index 4b1fa0a..f604433 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ -cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR) - project(lxqt-build-tools) +cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR) + option(WITH_XDG_DIRS_FALLBACK "Use our XDG_CONFIG_DIRS fallback" ON) set(LXQT_BUILD_TOOLS_MAJOR_VERSION 0) @@ -64,7 +64,7 @@ file(COPY configure_package_config_file( "${CMAKE_CURRENT_SOURCE_DIR}/lxqt-build-tools-config.cmake.in" - "${CMAKE_BINARY_DIR}/lxqt-build-tools.cmake" + "${CMAKE_BINARY_DIR}/lxqt-build-tools-config.cmake" INSTALL_DESTINATION "neverland" # required, altough we don't install it PATH_VARS MODULES_INSTALL_DIR diff --git a/cmake/find-modules/FindFm.cmake b/cmake/find-modules/FindFm.cmake new file mode 100644 index 0000000..a37d53d --- /dev/null +++ b/cmake/find-modules/FindFm.cmake @@ -0,0 +1,80 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# BSD-3-Clause file for details. + +#.rst: +# FindFm +# ----------- +# +# Try to find the Fm library +# +# Once done this will define +# +# :: +# +# FM_FOUND - System has the Fm library +# FM_INCLUDE_DIR - The Fm library include directory +# FM_INCLUDE_DIRS - Location of the headers needed to use the Fm library +# FM_LIBRARIES - The libraries needed to use the Fm library +# FM_DEFINITIONS - Compiler switches required for using the Fm library +# FM_VERSION_STRING - the version of the Fm library found + + +# use pkg-config to get the directories and then use these values +# in the find_path() and find_library() calls +find_package(PkgConfig QUIET) +pkg_check_modules(PC_FM QUIET libfm) +set(FM_DEFINITIONS ${PC_FM_CFLAGS_OTHER}) + +find_path(FM_INCLUDE_DIR NAMES libfm/fm.h + HINTS + ${PC_FM_INCLUDEDIR} + ${PC_FM_INCLUDE_DIRS} + PATH_SUFFIXES libfm +) + +find_library(FM_LIBRARIES NAMES fm libfm + HINTS + ${PC_FM_LIBDIR} + ${PC_FM_LIBRARY_DIRS} +) + + +# iterate over all dependencies +unset(FD_LIBRARIES) +foreach(depend ${PC_FM_LIBRARIES}) + find_library(_DEPEND_LIBRARIES + NAMES + ${depend} + HINTS + ${PC_FM_LIBDIR} + ${PC_FM_LIBRARY_DIRS} + ) + + if (_DEPEND_LIBRARIES) + list(APPEND FD_LIBRARIES ${_DEPEND_LIBRARIES}) + endif() + unset(_DEPEND_LIBRARIES CACHE) +endforeach() + +set(FM_VERSION_STRING ${PC_FM_VERSION}) +set(FM_INCLUDE_DIR ${PC_FM_INCLUDEDIR}) + +list(APPEND FM_INCLUDE_DIRS + ${FM_INCLUDE_DIR} + ${PC_FM_INCLUDE_DIRS} +) +list(REMOVE_DUPLICATES FM_INCLUDE_DIRS) + +list(APPEND FM_LIBRARIES + ${FD_LIBRARIES} +) + +list(REMOVE_DUPLICATES FM_LIBRARIES) +# handle the QUIETLY and REQUIRED arguments and set FM_FOUND to TRUE if +# all listed variables are TRUE +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(Fm + REQUIRED_VARS FM_LIBRARIES FM_INCLUDE_DIR FM_INCLUDE_DIRS + VERSION_VAR FM_VERSION_STRING) + +mark_as_advanced(FM_INCLUDE_DIR FM_LIBRARIES) diff --git a/cmake/find-modules/FindGLIB.cmake b/cmake/find-modules/FindGLIB.cmake new file mode 100644 index 0000000..28a47d5 --- /dev/null +++ b/cmake/find-modules/FindGLIB.cmake @@ -0,0 +1,126 @@ +# - Try to find Glib and its components (gio, gobject etc) +# Once done, this will define +# +# GLIB_FOUND - system has Glib +# GLIB_INCLUDE_DIRS - the Glib include directories +# GLIB_LIBRARIES - link these to use Glib +# +# Optionally, the COMPONENTS keyword can be passed to find_package() +# and Glib components can be looked for. Currently, the following +# components can be used, and they define the following variables if +# found: +# +# gio: GLIB_GIO_LIBRARIES +# gobject: GLIB_GOBJECT_LIBRARIES +# gmodule: GLIB_GMODULE_LIBRARIES +# gthread: GLIB_GTHREAD_LIBRARIES +# +# Note that the respective _INCLUDE_DIR variables are not set, since +# all headers are in the same directory as GLIB_INCLUDE_DIRS. +# +# Copyright (C) 2012 Raphael Kubo da Costa +# Copyright (C) 2016 Luís Pereira +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND ITS CONTRIBUTORS ``AS +# IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR ITS +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +find_package(PkgConfig) +pkg_check_modules(PC_GLIB QUIET glib-2.0) + +find_library(GLIB_LIBRARIES + NAMES glib-2.0 + HINTS ${PC_GLIB_LIBDIR} + ${PC_GLIB_LIBRARY_DIRS} +) + +# Files in glib's main include path may include glibconfig.h, which, +# for some odd reason, is normally in $LIBDIR/glib-2.0/include. +get_filename_component(_GLIB_LIBRARY_DIR ${GLIB_LIBRARIES} PATH) +find_path(GLIBCONFIG_INCLUDE_DIR + NAMES glibconfig.h + HINTS ${PC_LIBDIR} ${PC_LIBRARY_DIRS} ${_GLIB_LIBRARY_DIR} + ${PC_GLIB_INCLUDEDIR} ${PC_GLIB_INCLUDE_DIRS} + PATH_SUFFIXES glib-2.0/include +) + +find_path(GLIB_INCLUDE_DIR + NAMES glib.h + HINTS ${PC_GLIB_INCLUDEDIR} + ${PC_GLIB_INCLUDE_DIRS} + PATH_SUFFIXES glib-2.0 +) + +set(GLIB_INCLUDE_DIRS ${GLIB_INCLUDE_DIR} ${GLIBCONFIG_INCLUDE_DIR}) + +# Version detection +if (EXISTS "${GLIBCONFIG_INCLUDE_DIR}/glibconfig.h") + file(READ "${GLIBCONFIG_INCLUDE_DIR}/glibconfig.h" GLIBCONFIG_H_CONTENTS) + string(REGEX MATCH "#define GLIB_MAJOR_VERSION ([0-9]+)" _dummy "${GLIBCONFIG_H_CONTENTS}") + set(GLIB_VERSION_MAJOR "${CMAKE_MATCH_1}") + string(REGEX MATCH "#define GLIB_MINOR_VERSION ([0-9]+)" _dummy "${GLIBCONFIG_H_CONTENTS}") + set(GLIB_VERSION_MINOR "${CMAKE_MATCH_1}") + string(REGEX MATCH "#define GLIB_MICRO_VERSION ([0-9]+)" _dummy "${GLIBCONFIG_H_CONTENTS}") + set(GLIB_VERSION_MICRO "${CMAKE_MATCH_1}") + set(GLIB_VERSION "${GLIB_VERSION_MAJOR}.${GLIB_VERSION_MINOR}.${GLIB_VERSION_MICRO}") +endif () + +# Additional Glib components. We only look for libraries, as not all of them +# have corresponding headers and all headers are installed alongside the main +# glib ones. +foreach (_component ${GLIB_FIND_COMPONENTS}) + if (${_component} STREQUAL "gio") + find_library(GLIB_GIO_LIBRARIES NAMES gio-2.0 HINTS ${_GLIB_LIBRARY_DIR}) + set(ADDITIONAL_REQUIRED_VARS ${ADDITIONAL_REQUIRED_VARS} GLIB_GIO_LIBRARIES) + elseif (${_component} STREQUAL "gobject") + find_library(GLIB_GOBJECT_LIBRARIES NAMES gobject-2.0 HINTS ${_GLIB_LIBRARY_DIR}) + set(ADDITIONAL_REQUIRED_VARS ${ADDITIONAL_REQUIRED_VARS} GLIB_GOBJECT_LIBRARIES) + elseif (${_component} STREQUAL "gmodule") + find_library(GLIB_GMODULE_LIBRARIES NAMES gmodule-2.0 HINTS ${_GLIB_LIBRARY_DIR}) + set(ADDITIONAL_REQUIRED_VARS ${ADDITIONAL_REQUIRED_VARS} GLIB_GMODULE_LIBRARIES) + elseif (${_component} STREQUAL "gthread") + find_library(GLIB_GTHREAD_LIBRARIES NAMES gthread-2.0 HINTS ${_GLIB_LIBRARY_DIR}) + set(ADDITIONAL_REQUIRED_VARS ${ADDITIONAL_REQUIRED_VARS} GLIB_GTHREAD_LIBRARIES) + elseif (${_component} STREQUAL "gio-unix") + pkg_check_modules(GIO_UNIX QUIET gio-unix-2.0) + find_path(GLIB_GIO_UNIX_INCLUDE_DIR + NAMES gio/gunixconnection.h + HINTS ${GIO_UNIX_INCLUDEDIR} + PATH_SUFFIXES gio-unix-2.0) + + set(ADDITIONAL_REQUIRED_VARS ${ADDITIONAL_REQUIRED_VARS} GLIB_GIO_UNIX_INCLUDE_DIR) + endif () +endforeach () + +include(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(GLIB REQUIRED_VARS GLIB_INCLUDE_DIRS GLIB_LIBRARIES ${ADDITIONAL_REQUIRED_VARS} + VERSION_VAR GLIB_VERSION) + +mark_as_advanced( + GLIBCONFIG_INCLUDE_DIR + GLIB_GIO_LIBRARIES + GLIB_GIO_UNIX_INCLUDE_DIR + GLIB_GMODULE_LIBRARIES + GLIB_GOBJECT_LIBRARIES + GLIB_GTHREAD_LIBRARIES + GLIB_INCLUDE_DIR + GLIB_INCLUDE_DIRS + GLIB_LIBRARIES +) diff --git a/cmake/find-modules/FindMenuCache.cmake b/cmake/find-modules/FindMenuCache.cmake new file mode 100644 index 0000000..350bf05 --- /dev/null +++ b/cmake/find-modules/FindMenuCache.cmake @@ -0,0 +1,88 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# BSD-3-Clause file for details. + +#.rst: +# FindMenuCache +# ----------- +# +# Try to find the MenuCache library +# +# Once done this will define +# +# :: +# +# MENUCACHE_FOUND - System has the MenuCache library +# MENUCACHE_INCLUDE_DIR - The MenuCache library include directory +# MENUCACHE_INCLUDE_DIRS - Location of the headers needed to use the MenuCache library +# MENUCACHE_LIBRARIES - The libraries needed to the MenuCache library +# MENUCACHE_DEFINITIONS - Compiler switches required for using the MenuCache library +# MENUCACHE_VERSION_STRING - the version of MenuCache library found + + +# use pkg-config to get the directories and then use these values +# in the find_path() and find_library() calls +find_package(PkgConfig QUIET) +pkg_check_modules(PC_MENUCACHE QUIET libmenu-cache) +set(MENUCACHE_DEFINITIONS ${PC_MENUCACHE_CFLAGS_OTHER}) + +find_path(MENUCACHE_INCLUDE_DIRS + NAMES + menu-cache.h + menu-cache/menu-cache.h + HINTS + ${PC_MENUCACHE_INCLUDEDIR} + ${PC_MENUCACHE_INCLUDE_DIRS} + PATH_SUFFIXES + libmenu-cache +) + +find_library(MENUCACHE_LIBRARIES + NAMES + menu-cache + libmenu-cache + HINTS + ${PC_MENUCACHE_LIBDIR} + ${PC_MENUCACHE_LIBRARY_DIRS} +) + + +# iterate over all dependencies +unset(FD_LIBRARIES) +foreach(depend ${PC_MENUCACHE_LIBRARIES}) + find_library(_DEPEND_LIBRARIES + NAMES + ${depend} + HINTS + ${PC_MENUCACHE_LIBDIR} + ${PC_MENUCACHE_LIBRARY_DIRS} + ) + + if (_DEPEND_LIBRARIES) + list(APPEND FD_LIBRARIES ${_DEPEND_LIBRARIES}) + endif() + unset(_DEPEND_LIBRARIES CACHE) +endforeach() + +set(MENUCACHE_VERSION_STRING ${PC_MENUCACHE_VERSION}) +set(MENUCACHE_INCLUDE_DIR ${PC_MENUCACHE_INCLUDEDIR}) + +list(APPEND MENUCACHE_INCLUDE_DIRS + ${MENUCACHE_INCLUDE_DIR} + ${PC_MENUCACHE_INCLUDE_DIRS} +) +list(REMOVE_DUPLICATES MENUCACHE_INCLUDE_DIRS) + +list(APPEND MENUCACHE_LIBRARIES + ${FD_LIBRARIES} +) + +list(REMOVE_DUPLICATES MENUCACHE_LIBRARIES) + +# handle the QUIETLY and REQUIRED arguments and set MENUCACHE_FOUND to TRUE if +# all listed variables are TRUE +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(MenuCache + REQUIRED_VARS MENUCACHE_LIBRARIES MENUCACHE_INCLUDE_DIR MENUCACHE_INCLUDE_DIRS + VERSION_VAR MENUCACHE_VERSION_STRING) + +mark_as_advanced(MENUCACHE_INCLUDE_DIR MENUCACHE_LIBRARIES) diff --git a/cmake/find-modules/FindUDev.cmake b/cmake/find-modules/FindUDev.cmake new file mode 100644 index 0000000..5e042e4 --- /dev/null +++ b/cmake/find-modules/FindUDev.cmake @@ -0,0 +1,65 @@ +# - Try to find the UDev library +# Once done this will define +# +# UDEV_FOUND - system has UDev +# UDEV_INCLUDE_DIR - the libudev include directory +# UDEV_LIBS - The libudev libraries + +# Copyright (c) 2010, Rafael Fernández López, +# Copyright (c) 2016, Luís Pereira, +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. Neither the name of the University nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. + +find_package(PkgConfig) +pkg_check_modules(PC_UDEV QUIET libudev) + +find_path(UDEV_INCLUDE_DIR libudev.h + HINTS ${PC_UDEV_INCLUDEDIR} ${PC_UDEV_INCLUDE_DIRS}) + +find_library(UDEV_LIBS udev HINTS ${PC_UDEV_LIBDIR} ${PC_UDEV_LIBRARY_DIRS}) + +if(UDEV_INCLUDE_DIR AND UDEV_LIBS) + include(CheckFunctionExists) + include(CMakePushCheckState) + cmake_push_check_state() + set(CMAKE_REQUIRED_LIBRARIES ${UDEV_LIBS} ) + + cmake_pop_check_state() + +endif() + +set(UDEV_VERSION_STRING ${PC_UDEV_VERSION}) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(UDev + REQUIRED_VARS UDEV_INCLUDE_DIR UDEV_LIBS + VERSION_VAR ${UDEV_VERSION_STRING}) + +mark_as_advanced(UDEV_INCLUDE_DIR UDEV_LIBS) + +include(FeatureSummary) +set_package_properties(UDev PROPERTIES + URL "https://www.kernel.org/pub/linux/utils/kernel/hotplug/udev/udev.html" + DESCRIPTION "Linux dynamic device management") diff --git a/cmake/find-modules/FindXCB.cmake b/cmake/find-modules/FindXCB.cmake new file mode 100644 index 0000000..98445bc --- /dev/null +++ b/cmake/find-modules/FindXCB.cmake @@ -0,0 +1,53 @@ +#.rst: +# FindXCB +# ------- +# +# Find XCB libraries +# +# Tries to find xcb libraries on unix systems. +# +# - Be sure to set the COMPONENTS to the components you want to link to +# - The XCB_LIBRARIES variable is set ONLY to your COMPONENTS list +# - To use only a specific component check the XCB_LIBRARIES_${COMPONENT} variable +# +# The following values are defined +# +# :: +# +# XCB_FOUND - True if xcb is available +# XCB_INCLUDE_DIRS - Include directories for xcb +# XCB_LIBRARIES - List of libraries for xcb +# XCB_DEFINITIONS - List of definitions for xcb +# +#============================================================================= +# Copyright (c) 2015 Jari Vetoniemi +# +# Distributed under the OSI-approved BSD License (the "License"); +# +# This software is distributed WITHOUT ANY WARRANTY; without even the +# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the License for more information. +#============================================================================= + +include(FeatureSummary) +set_package_properties(XCB PROPERTIES + URL "http://xcb.freedesktop.org/" + DESCRIPTION "X protocol C-language Binding") + +find_package(PkgConfig) +pkg_check_modules(PC_XCB QUIET xcb ${XCB_FIND_COMPONENTS}) + +find_library(XCB_LIBRARIES xcb HINTS ${PC_XCB_LIBRARY_DIRS}) +find_path(XCB_INCLUDE_DIRS xcb/xcb.h PATH_SUFFIXES xcb HINTS ${PC_XCB_INCLUDE_DIRS}) + +foreach(COMPONENT ${XCB_FIND_COMPONENTS}) + find_library(XCB_LIBRARIES_${COMPONENT} ${COMPONENT} HINTS ${PC_XCB_LIBRARY_DIRS}) + list(APPEND XCB_LIBRARIES ${XCB_LIBRARIES_${COMPONENT}}) + mark_as_advanced(XCB_LIBRARIES_${COMPONENT}) +endforeach(COMPONENT ${XCB_FIND_COMPONENTS}) + +set(XCB_DEFINITIONS ${PC_XCB_CFLAGS_OTHER}) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(XCB DEFAULT_MSG XCB_LIBRARIES XCB_INCLUDE_DIRS) +mark_as_advanced(XCB_INCLUDE_DIRS XCB_LIBRARIES XCB_DEFINITIONS) diff --git a/cmake/modules/LXQtCompilerSettings.cmake b/cmake/modules/LXQtCompilerSettings.cmake index 43f9485..a2a029b 100644 --- a/cmake/modules/LXQtCompilerSettings.cmake +++ b/cmake/modules/LXQtCompilerSettings.cmake @@ -27,6 +27,13 @@ # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #============================================================================= +#----------------------------------------------------------------------------- +# Build with release mode by default (turn on compiler optimizations) +#----------------------------------------------------------------------------- +if (NOT CMAKE_BUILD_TYPE) + set(CMAKE_BUILD_TYPE Release) +endif() + #----------------------------------------------------------------------------- # Honor visibility properties for all target types. # @@ -112,12 +119,40 @@ endif() # Do not allow undefined symbols #----------------------------------------------------------------------------- if (CMAKE_COMPILER_IS_GNUCXX OR LXQT_COMPILER_IS_CLANGCXX) + # -Bsymbolic-functions: replace dynamic symbols used internally in + # shared libs with direct addresses. + set(SYMBOLIC_FLAGS + "-Wl,-Bsymbolic-functions -Wl,-Bsymbolic" + ) set(CMAKE_SHARED_LINKER_FLAGS - "-Wl,--no-undefined ${CMAKE_SHARED_LINKER_FLAGS}" + "-Wl,--no-undefined ${SYMBOLIC_FLAGS} ${CMAKE_SHARED_LINKER_FLAGS}" ) set(CMAKE_MODULE_LINKER_FLAGS - "-Wl,--no-undefined ${CMAKE_MODULE_LINKER_FLAGS}" + "-Wl,--no-undefined ${SYMBOLIC_FLAGS} ${CMAKE_MODULE_LINKER_FLAGS}" ) + set(CMAKE_EXE_LINKER_FLAGS + "${SYMBOLIC_FLAGS} ${CMAKE_EXE_LINKER_FLAGS}" + ) + +endif() + + +#----------------------------------------------------------------------------- +# Turn on more aggrassive optimizations not supported by CMake +# References: https://wiki.qt.io/Performance_Tip_Startup_Time +#----------------------------------------------------------------------------- +if (CMAKE_COMPILER_IS_GNUCXX OR LXQT_COMPILER_IS_CLANGCXX) + # -flto: use link-time optimizations to generate more efficient code + if (CMAKE_COMPILER_IS_GNUCXX) + set(LTO_FLAGS "-flto -fuse-linker-plugin") + elseif (LXQT_COMPILER_IS_CLANGCXX) + # The link-time optimization of clang++/llvm seems to be too aggrassive. + # After testing, it breaks the signal/slots of QObject sometimes. + # So disable it for now until there is a solution. + # set(LTO_FLAGS "-flto") + endif() + # apply these options to "Release" build type only + set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${LTO_FLAGS}") endif() @@ -135,6 +170,15 @@ else() endif() +#----------------------------------------------------------------------------- +# Enable colored diagnostics for the CLang/Ninja combination +#----------------------------------------------------------------------------- +if (LXQT_COMPILER_IS_CLANGCXX AND CMAKE_GENERATOR STREQUAL "Ninja") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fcolor-diagnostics") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fcolor-diagnostics") +endif() + + #----------------------------------------------------------------------------- # Enable exceptions for an target # diff --git a/debian/changelog b/debian/changelog index db5dbba..65a0c28 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +lxqt-build-tools (0.3.0-1) unstable; urgency=medium + + * Cherry-picking upstream version 0.3.0. + * Fixed VCS-Fields to branch debian/sid + + -- Alf Gaida Tue, 06 Dec 2016 22:27:16 +0100 + lxqt-build-tools (0.2.0-3) unstable; urgency=medium * Added missed dependency libqt5xdg-dev (>= 2.0.0) diff --git a/debian/control b/debian/control index ac0bcce..3e82cb8 100644 --- a/debian/control +++ b/debian/control @@ -8,8 +8,8 @@ Build-Depends: debhelper (>= 10), cmake (>= 3.0.2), qtbase5-dev Standards-Version: 3.9.8 -Vcs-Browser: https://anonscm.debian.org/cgit/pkg-lxqt/lxqt-build-tools.git/?h=lxqt-snapshots/latest -Vcs-Git: https://anonscm.debian.org/git/pkg-lxqt/lxqt-build-tools.git -b lxqt-snapshots/latest +Vcs-Browser: https://anonscm.debian.org/cgit/pkg-lxqt/lxqt-build-tools.git/?h=debian/sid +Vcs-Git: https://anonscm.debian.org/git/pkg-lxqt/lxqt-build-tools.git -b debian/sid Homepage: https://github.com/lxde/lxqt-build-tools Package: lxqt-build-tools