From e97b2293b3cc98b9193915248343e77745e2d3fe Mon Sep 17 00:00:00 2001 From: Robert Adam Date: Mon, 31 Aug 2020 17:30:23 +0200 Subject: [PATCH 1/3] MAINT: Added BUILD type to commit guidelines --- COMMIT_GUIDELINES.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/COMMIT_GUIDELINES.md b/COMMIT_GUIDELINES.md index 37fb78fb5..b2cc41ea6 100644 --- a/COMMIT_GUIDELINES.md +++ b/COMMIT_GUIDELINES.md @@ -48,7 +48,8 @@ The `TYPE` is one of the following: | TEST | Adds, changes or removes a test-case | | | MAINT | Maintenance - Change of non-code files | Change of the README | | CI | Changed something for the CI (continous integration) | Update TravisCI to use newer ubuntu version | -| REFAC | Code refactoring | Renamed variable `x` to `y` | +| REFAC | Code refactoring | Renamed variable `x` to `y` | +| BUILD | Changes related to the build process / buildsystem | Fixed cmake script | The `TYPE` has to be in **all-uppercase** in order for it to stand out. From 9697863c1f26731dc801d1abd291b3b2eaabe1b9 Mon Sep 17 00:00:00 2001 From: Robert Adam Date: Mon, 31 Aug 2020 17:16:14 +0200 Subject: [PATCH 2/3] BUILD(cmake): Start cmake output with info header Instead of only printing the Mumble version that is being built, the architecture that cmake is currently configuring for is displayed as well. In order to make this information more visible, they are surrounded by a row of hashtags. This change should make it more obvious to users if they happen to build the wrong version/architecture (as can easily happen on Windows). --- CMakeLists.txt | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ca2d15463..f16a72adf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,8 +19,6 @@ project(Mumble LANGUAGES "C" "CXX" ) -message(STATUS "Mumble version: ${version}") - set(3RDPARTY_DIR "${CMAKE_SOURCE_DIR}/3rdparty") set(CMAKE_CXX_STANDARD 14) @@ -77,6 +75,15 @@ endif() include(compiler) include(os) +message(STATUS "##################################################") +message(STATUS "Building Mumble version: ${version}") +if(64_BIT) + message(STATUS "Architecture: 64bit (x64)") +else() + message(STATUS "Architecture: 32bit (x86)") +endif() +message(STATUS "##################################################") + add_subdirectory(src) if(g15 AND WIN32) From fda302af9819d8391ea9972e97c9e2200bbfd520 Mon Sep 17 00:00:00 2001 From: Robert Adam Date: Mon, 31 Aug 2020 17:18:42 +0200 Subject: [PATCH 3/3] BUILD(cmake): Added debug-dependency-search option If the user uses -Ddebug-dependency-search=OFF, then the find_pkg function will not perform its searches using the QUIET flag causing a lot of (valuable) information to be printed to the screen. --- CMakeLists.txt | 2 ++ cmake/pkg-utils.cmake | 23 +++++++++++++++-------- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f16a72adf..695362c2f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -47,6 +47,8 @@ option(overlay "Build overlay." ON) option(packaging "Build package." OFF) option(plugins "Build plugins." ON) +option(debug-dependency-search "Prints extended information during the search for the needed dependencies" OFF) + # We support the "Debug" and "Release" configurations. set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" diff --git a/cmake/pkg-utils.cmake b/cmake/pkg-utils.cmake index 02ef906cb..6676e12e6 100644 --- a/cmake/pkg-utils.cmake +++ b/cmake/pkg-utils.cmake @@ -3,7 +3,14 @@ # that can be found in the LICENSE file at the root of the # Mumble source tree or at . -find_package(PkgConfig QUIET) +if(debug-dependency-search) + # Don't be quiet if the user wants to debug the dependency-search + set(QUIET_STR "") +else() + set(QUIET_STR "QUIET") +endif() + +find_package(PkgConfig ${QUIET_STR}) include(FindPackageMessage) @@ -15,7 +22,7 @@ function(pkgconfig_search MODULE) # We don't want pkg_search_module() to write into the variables that will be passed to the pkgconfig_search()'s caller. set(PRIVATE "PRIVATE_${MODULE}") - pkg_search_module(${PRIVATE} ${MODULE} QUIET) + pkg_search_module(${PRIVATE} ${MODULE} ${QUIET_STR}) if(NOT ${PRIVATE}_FOUND) return() @@ -67,9 +74,9 @@ macro(find_pkg ARG_ALIASES) if(FIND_PACKAGE_COMPONENTS) foreach(COMPONENT ${FIND_PACKAGE_COMPONENTS}) - find_package(${NAME} COMPONENTS ${COMPONENT} ${FIND_PACKAGE_ARGUMENTS} QUIET CONFIG ${FIND_PACKAGE_UNPARSED_ARGUMENTS}) + find_package(${NAME} COMPONENTS ${COMPONENT} ${FIND_PACKAGE_ARGUMENTS} ${QUIET_STR} CONFIG ${FIND_PACKAGE_UNPARSED_ARGUMENTS}) if(NOT ${NAME}_FOUND) - find_package(${NAME} COMPONENTS ${COMPONENT} ${FIND_PACKAGE_ARGUMENTS} QUIET MODULE ${FIND_PACKAGE_UNPARSED_ARGUMENTS}) + find_package(${NAME} COMPONENTS ${COMPONENT} ${FIND_PACKAGE_ARGUMENTS} ${QUIET_STR} MODULE ${FIND_PACKAGE_UNPARSED_ARGUMENTS}) endif() if(NOT ${NAME}_FOUND) @@ -101,9 +108,9 @@ macro(find_pkg ARG_ALIASES) continue() endif() else() - find_package(${NAME} ${FIND_PACKAGE_ARGUMENTS} QUIET CONFIG ${FIND_PACKAGE_UNPARSED_ARGUMENTS}) + find_package(${NAME} ${FIND_PACKAGE_ARGUMENTS} ${QUIET_STR} CONFIG ${FIND_PACKAGE_UNPARSED_ARGUMENTS}) if(NOT ${NAME}_FOUND) - find_package(${NAME} ${FIND_PACKAGE_ARGUMENTS} QUIET MODULE ${FIND_PACKAGE_UNPARSED_ARGUMENTS}) + find_package(${NAME} ${FIND_PACKAGE_ARGUMENTS} ${QUIET_STR} MODULE ${FIND_PACKAGE_UNPARSED_ARGUMENTS}) if(NOT ${NAME}_FOUND) pkgconfig_search(${NAME}) endif() @@ -136,9 +143,9 @@ macro(find_pkg ARG_ALIASES) if(FIND_PACKAGE_OPTIONAL_COMPONENTS) foreach(COMPONENT ${FIND_PACKAGE_OPTIONAL_COMPONENTS}) - find_package(${NAME} COMPONENTS ${COMPONENT} ${FIND_PACKAGE_ARGUMENTS} QUIET CONFIG ${FIND_PACKAGE_UNPARSED_ARGUMENTS}) + find_package(${NAME} COMPONENTS ${COMPONENT} ${FIND_PACKAGE_ARGUMENTS} ${QUIET_STR} CONFIG ${FIND_PACKAGE_UNPARSED_ARGUMENTS}) if(NOT ${NAME}_FOUND) - find_package(${NAME} COMPONENTS ${COMPONENT} ${FIND_PACKAGE_ARGUMENTS} QUIET MODULE ${FIND_PACKAGE_UNPARSED_ARGUMENTS}) + find_package(${NAME} COMPONENTS ${COMPONENT} ${FIND_PACKAGE_ARGUMENTS} ${QUIET_STR} MODULE ${FIND_PACKAGE_UNPARSED_ARGUMENTS}) endif() if(${NAME}_FOUND AND NOT FIND_PACKAGE_QUIET)