aboutsummaryrefslogtreecommitdiff
path: root/kde-modules
AgeCommit message (Collapse)Author
2022-08-13Add OpenBSD supportRafael Sadowski
2022-08-08Revert "clang-format.cmake: don't change spaces after '//' in code comments"Ahmad Samir
This reverts commit 178c4dfbf4eb5ad7c5aef4838f190f717f97766f. Instead of creating an MR, I forgot I was on master... GIT_SILENT
2022-08-08clang-format.cmake: don't change spaces after '//' in code commentsAhmad Samir
For example, if you have: //This is a comment now clang-format won't change it to: // This is a comment We're mainly interested in formatting the code, not the comments, so that cuts down on some noise when running clang-format. CCBUG: 456819
2022-07-15kde-modules/KDEGitCommitHooks.cmake - handle non-toplevel projectv5.97.0-rc1v5.97.0Allen Winter
Only install pre-commit hooks if KDE_CONFIGURE_GIT_PRE_COMMIT_HOOK is called frm CMAKE_CURRENT_PROEJECT, eg. don't install pre-commit hooks if ECM is inside a submodule or fetched-content.
2022-06-25ECMDeprecationSettings: enable warnings by defaultv5.96.0-rc1v5.96.0Friedrich W. H. Kossebau
The main target consumers of this macro currently (should) want to be informed about new deprecations as early as possible. As do the authors of the warnings. So instead let's make no warnings an opt-in. Not documenting the now deprecated flag in the docs, given no wide-spread use yet, just supporting still in the code with a note to users.
2022-06-15Document addition of -Werror=undefAhmad Samir
2022-06-15Change -Wundef warning to an errorAhmad Samir
This should catch undefined preprocessor expressions, i.e. instead of showing a warning if FOO_BAR_H is undefined: #if FOO_BAR_H make the build fai lwith an error instead. This combined with using #cmakedefine01 (instead of #cmakedefine), could catch things like: https://invent.kde.org/pim/kdepim-runtime/-/commit/05a0e5bbfbb06ed6aa88640f25f563cf7e5b1330
2022-06-12API dox: turn some more verbal "Note" into full note sectionsFriedrich W. H. Kossebau
Should help readers being aware of pitfalls NO_CHANGELOG
2022-06-12API dox: fix sphinx warning about Title underline too shortFriedrich W. H. Kossebau
NO_CHANGELOG
2022-06-12API dox: use more markup for code or commandline samplesFriedrich W. H. Kossebau
NO_CHANGELOG
2022-06-12API dox: improve linking to other modules referenced in textFriedrich W. H. Kossebau
NO_CHANGELOG
2022-06-06fix linking on OpenBSDChristoph Cullmann
OpenBSD has a similar patch inside the ports, see Allow KDE5 libraries to be built without having to link to libc explicitly. Index: kde-modules/KDECompilerSettings.cmake --- kde-modules/KDECompilerSettings.cmake.orig +++ kde-modules/KDECompilerSettings.cmake @@ -530,6 +530,8 @@ endfunction() # Better diagnostics (warnings, errors) ############################################################ +set(ALLOW_UNDEFINED_LIB_SYMBOLS No CACHE BOOL "allow undefined symbols in generated shared objects") + if ((CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND NOT APPLE) OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND NOT APPLE) OR (CMAKE_CXX_COMPILER_ID STREQUAL "Intel" AND NOT WIN32)) @@ -537,9 +539,11 @@ if ((CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND NOT APPL set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--fatal-warnings ${CMAKE_SHARED_LINKER_FLAGS}") set(CMAKE_MODULE_LINKER_FLAGS "-Wl,--fatal-warnings ${CMAKE_MODULE_LINKER_FLAGS}") - # Do not allow undefined symbols, even in non-symbolic shared libraries - set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--no-undefined ${CMAKE_SHARED_LINKER_FLAGS}") - set(CMAKE_MODULE_LINKER_FLAGS "-Wl,--no-undefined ${CMAKE_MODULE_LINKER_FLAGS}") + if (NOT ${ALLOW_UNDEFINED_LIB_SYMBOLS}) + # Do not allow undefined symbols, even in non-symbolic shared libraries + set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--no-undefined ${CMAKE_SHARED_LINKER_FLAGS}") + set(CMAKE_MODULE_LINKER_FLAGS "-Wl,--no-undefined ${CMAKE_MODULE_LINKER_FLAGS}") + endif() endif() set(_KDE_GCC_COMMON_WARNING_FLAGS "-Wall -Wextra -Wcast-align -Wchar-subscripts -Wformat-security -Wno-long-long -Wpointer-arith -Wundef")
2022-05-30KDEGitCommitHooks: Check if KDEClangFormat was includedAlexander Lohnau
If the module is not included, the current message would be misleading. Including the module by default is undesirable, because we print out a warning that we do not override an existing module. While this warning is reasonable in most cases, it is annoying for projects that have a custom clang-format file. Checking if a .clang-format file exists and if not including KDEClangFormat is fragile, because it depends on the include order of the modules. Considering all that, a proper warning with instructions on how to fix the issue is IMHO the best way to go.
2022-05-10KDEGitCommitHooks: Fix quoting of variablesAlex Richardson
I was getting CMake errors in repositories that had a pre-existing commit hook: `string sub-command FIND requires 3 or 4 parameters.` Adding quotes around the variables from 6224e7b8c28d434b81a19ac47b88cb58fee9d7d5 fixes this issue for me.
2022-04-10KDEGitCommitHooks: don't overwrite git pre-commit hook scriptAhmad Samir
If the .git/hooks/pre-commit already exists, only add the clang-format line if it doesn't already exist.
2022-04-10KDEGitCommitHooks: only configure pre-commit hook if neededAhmad Samir
If clang-format isn't found, there is nothing to write to the file.
2022-03-24KDEInstallDirs6: port from custom logic to ecm_query_qtAhmad Samir
2022-03-24Port from ECMQueryQmake to ECMQueryQtAhmad Samir
Continuation of commit 4e47b053c9d799. All unittests still pass.
2022-03-21Fix clang-format git hook scriptAhmad Samir
It should be --extensions "cpp,h,hpp,c"; previously, I naively tested that it didn't bother .json files, but I not if it'll actually trigger for e.g. a .h file...
2022-03-17KDEClangFormat: se the same source file extensions in clang-format script ↵Ahmad Samir
and target Previously the clang-format.sh git hook script didn't specify the file extensions to format; however it looks like with recent(?) clang-format versions 'git clang-format' will consider .json files if such files were changed by a commit, which makes the script fail, see: https://invent.kde.org/frameworks/extra-cmake-modules/-/merge_requests/254 Sepcify the file extensions by passing --extensions to 'git clang-format' command. Also add ".hpp" to the file extensions we format, and use the same list of file extensions everywhere.
2022-03-12Fix checking the repository name for detached remotesAleix Pol
If we are not tracking a specific branch, assume the remote is "origin" which is git's default.
2022-03-06Check that you're building the framework in a supported platformAlbert Astals Cid
2022-02-13KDEInstallDirs6: replace ECMQueryQMake usage with qtpathsAhmad Samir
This fixes KDEInstallDirsTest.relative_or_absolute_qt unittest.
2022-02-04Make clang-format Git hook work in worktrees The Assassin
Otherwise, commits will be rejected because the hook cannot be found from the workdir root dir (there is only one .git directory in a checkout, but commands are run relative to the worktree root dir).
2022-02-01kde_package_app_templates: drop atime,ctime, consistently set mtimeEmil Velikov
As outlined in https://reproducible-builds.org/docs/archives/ to ensure that tarballs are reproducible, one should honour SOURCE_DATE_EPOCH. In the case it's not, fallback to date +%s, set the mtime. Delete atime and ctime completely. No idea if this is better or worse. Based on the patch by: Brendan Tildesley <mail@brendan.scot> From: https://bugs.kde.org/show_bug.cgi?id=443532 v2: Emil - Split from larger patch - Fallback to date +%s v3: Emil - $ENV{...} to evaluate the variable Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2022-02-01kde_package_app_templates: use numeric owner/group with tarEmil Velikov
In some build environments like in Guix, the GID of "root" is not consistent. With --numeric-owner, we only need to specify UID and GID, the user name is unneeded, so set --owner=0 --group=0 Based on the patch by: Brendan Tildesley <mail@brendan.scot> From: https://bugs.kde.org/show_bug.cgi?id=443532 v2: Emil - Keep args reorder a separate commit - Move time changes into separate commit Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2022-02-01kde_package_app_templates: reorder and spli tar argsEmil Velikov
Split the arguments in separate lines, grouped appropriately. No functional changes. Suggested-by: @adridg Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2022-01-25Adapt KDEInstallDirs unit test to consider the new version-less variablesVolker Krause
Fixes unit tests with Qt6 and identified the missing definition of the full path variables for aliases.
2022-01-20Only enable -bsymbolic-functions when Qt is built in a compatible wayVolker Krause
With Qt6 that isn't always the case, for example in our Linux CI image. Using -bsymbolic-function on the final executable in that case can result in function pointer conntect or method/signal lookups to fail. This can be observed in various unit test failures on the CI right now.
2022-01-09Rename KDEDeprecationSettings to ECMDeprecationSettingsAlexander Lohnau
Semantically this is an ECM module, because it can be used to manage deprecated Qt API and from any project which use ecm_generate_export_headers
2022-01-04Add ecm_set_deprecation_versions cmake functionAlexander Lohnau
This will make setting the deprecation versions easier, otherwise one would need to edit the hex value. It also helps to keep the required versions and deprecation versions in sync. Also this allows one to keep the deprecation warnings, when one excludes deprecations for a specific version. Additionally the deprecation version can be overwritten by a cmake parameter. This will make local testing easier, because one does not need to edit the CMakeLists.txt files. Task: https://phabricator.kde.org/T15109
2021-12-18Add missing prefix to version-less install directory aliasesVolker Krause
So far we were defining e.g. KSERVICESDIR next to KDE_INSTALL_KSERVICES5DIR here, rather than the intended KDE_INSTALL_KSERVICESDIR.
2021-12-05Define version-less install targets in KDEInstallDirs5.cmakeVolker Krause
This enables forward-compatibility with KDEInstallDirs6.cmake This was partly done already, but in the wrong order and not for all versioned variables.
2021-11-30Revert "If QT_MAJOR_VERSION is not defined, use 5"Volker Krause
There is no path out of QtVersionOption.cmake that would let QT_MAJOR_VERSION undefined, so this check is unnecessary. Worse, this doesn't actually check for QT_MAJOR_VERSION being defined, but whether a variable named after the content of the QT_MAJOR_VERSION variable is defined. That is always false, so this effectively forces Qt5 and breaks Qt6 support. This reverts commit 8fd79163a7c60386fbc94bc14ca4a3b0b29d7227.
2021-11-28If QT_MAJOR_VERSION is not defined, use 5Ivan Čukić
This fixes an infinite recursion of KDEInstallDirs including itself when QT_MAJOR_VERSION is not defined.
2021-11-23KDEInstallDirs5: set up KSERVICESDIR alias for KSERVICES5DIRDavid Faure
and use only KSERVICESDIR in KDEInstallDirs6.
2021-11-23KDEInstallDirs6: remove deprecated variables from the documentationDavid Faure
2021-11-23KDEInstallDirs6: comment out call to query_qmake, not definedDavid Faure
2021-11-23KDEInstallDirs6: don't set deprecated variable names anymoreDavid Faure
+ adjust docu
2021-11-23PLUGINDIR is based upon QTPLUGINDIR, so only define it after QTPLUGINDIRDavid Faure
2021-11-23Split KDEInstallDirs into a 5 and a 6 variantVolker Krause
This factors out large parts of the common code into separate modules, and adds a backward compatibility wrapper. The 6 variant drops some deprecated variables where possible, but otherwise is the same as the 5 variant. It still lacks a replacement for the paths depending on ECMQueryQMake though.
2021-10-25Revert "clang-format.cmake: Disable formatting for json files"v5.88.0-rc1v5.88.0Alexander Lohnau
This breaks older clang-format version :/ This reverts commit 81f70c9639154dcd067d73b0620767d8ba0362cf.
2021-10-24clang-format.cmake: Disable formatting for json filesAlexander Lohnau
This is only supported in the latest clang-format version. Having formatting enabled would cause it to complain about no rules being set for json files.
2021-10-24GIT_SILENT Fix check in prefix.sh.fish script if ENV vars are already setAlexander Lohnau
2021-10-10msvc: Fix __cplusplus valueAleix Pol
Ensure /Zc:__cplusplus is passed when using newer C++ standards. https://docs.microsoft.com/en-us/cpp/build/reference/zc-cplusplus?view=msvc-160
2021-09-28Add -Werror=init-self to the default CMAKE_CXX_FLAGSAhmad Samir
Should help catch errors like initializing a q-ptr with itself[1]. [1] https://invent.kde.org/frameworks/knewstuff/-/commit/d09ba1917cb7e035a9aac6c27c86fc4df5da3194
2021-09-27Handle git remotes that aren't called origin in _repository_name()Alex Richardson
I was seeing `error: No such remote 'origin'` in the cmake output. This commit avoids hardcoding `origin` as the upstream URL and instead uses the `git rev-parse @{u}` to get the configured upstream. As a follow-up we may want to check if this should be executed by default, but for now this fixes a warning that I'm seeing with various projects.
2021-09-20clang-format: extend ForeachMacrosDavid Edmundson
wl_resource_for_each_safe is used in kwayland-server, and as the name suggests is a for-each like function.
2021-09-20Avoid raising an error for submodule git trees.Damien Caliste
2021-09-11KDEClangFormat: Check for autogeneration notice instead of copyright textAlexander Lohnau
If people ship their own clang-format file they might still have the copyright, because they forked it. Instead search for the notice that the file is autogenerated.