Skip to content

various cmake improvements#2176

Merged
BareosBot merged 61 commits intobareos:masterfrom
arogge:dev/arogge/master/spring-cleanup
May 15, 2025
Merged

various cmake improvements#2176
BareosBot merged 61 commits intobareos:masterfrom
arogge:dev/arogge/master/spring-cleanup

Conversation

@arogge
Copy link
Member

@arogge arogge commented Feb 14, 2025

This PR tries to clean up cmake.
The main goal is to leverage target-dependencies instead of plain library-links. As we linked plain libraries instead of targets by mistake, the PR should also make this impossible.

For debugging our project now supports a flag DEBUG_TARGET_DEPENDENCIES that will dump (hopefully helpful) information about target dependencies into the binary dir.

Please check

  • Short description and the purpose of this PR is present above this paragraph
  • Your name is present in the AUTHORS file (optional)

If you have any questions or problems, please give a comment in the PR.

Helpful documentation and best practices

Checklist for the reviewer of the PR (will be processed by the Bareos team)

Make sure you check/merge the PR using devtools/pr-tool to have some simple automated checks run and a proper changelog record added.

General
  • Is the PR title usable as CHANGELOG entry?
  • Purpose of the PR is understood
  • Commit descriptions are understandable and well formatted
    Required backport PRs have been created
  • Correct milestone is set
Source code quality
  • Source code changes are understandable
  • Variable and function names are meaningful
  • Code comments are correct (logically and spelling)
  • Required documentation changes are present and part of the PR

@arogge arogge self-assigned this Feb 17, 2025
@arogge arogge force-pushed the dev/arogge/master/spring-cleanup branch 2 times, most recently from c8854a1 to 1a64e3a Compare March 4, 2025 12:58
@arogge arogge added the nobuild label Mar 7, 2025
@arogge arogge force-pushed the dev/arogge/master/spring-cleanup branch 5 times, most recently from 3c748ae to 4fb640b Compare March 10, 2025 18:58
@arogge arogge removed the nobuild label Mar 10, 2025
@arogge arogge force-pushed the dev/arogge/master/spring-cleanup branch 3 times, most recently from 773b7d5 to 2b32538 Compare March 17, 2025 15:53
@arogge arogge force-pushed the dev/arogge/master/spring-cleanup branch from 8944769 to 8be4a67 Compare March 18, 2025 15:45
@arogge arogge force-pushed the dev/arogge/master/spring-cleanup branch 3 times, most recently from 0f2cd6e to 6695184 Compare April 2, 2025 08:26
@arogge arogge force-pushed the dev/arogge/master/spring-cleanup branch 2 times, most recently from 81d79a6 to 13d6992 Compare April 8, 2025 08:57
@arogge arogge requested a review from sebsura April 14, 2025 09:24
@arogge arogge force-pushed the dev/arogge/master/spring-cleanup branch from 910246e to 3f70d24 Compare April 14, 2025 16:23
@arogge arogge force-pushed the dev/arogge/master/spring-cleanup branch 3 times, most recently from dc5e339 to 8ece24b Compare May 9, 2025 10:43
@arogge arogge changed the title cmake cleanup various cmake improvements May 9, 2025
@arogge arogge marked this pull request as ready for review May 9, 2025 13:18
Copy link
Contributor

@sebsura sebsura left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

misclicked, and cannot change it now. See comments above.

@arogge arogge force-pushed the dev/arogge/master/spring-cleanup branch from 4f32447 to 1f65ea3 Compare May 13, 2025 14:56
arogge and others added 20 commits May 15, 2025 11:06
use cmake_minimum_required(VERSION <min>...<max>) to bulk-enable all the
policies up to and including those introduced in CMake version <max>.
we know these currently won't work correctly, so building them is
currently discouraged and disabled. If anyone needs this, she can
easily patch the CMakeLists.txt to remove the error.
these tests tend to fail randomly on busy systems. Increasing the
timeout should help to make the test more reliable.
Add a helper function for the tedious "if windows, configure file and
add to the target's sources".
as we always build with OpenSSL and have TLS enabled, the settings and
code to build with these disabled can be safely removed.
as we require ZLIB for building, we don't need these conditionals
anywhere in the build.
Remove HAVE_PQISTHREADSAFE which was always set to 1.
Also remove POSTGRESQL_BATCH_FILE_INSERT that is now unused.
as this cannot be determined ahead-of-time for every build/platform it
is probably better to rely on CTEST_PARALLEL_LEVEL being set in the
environment.
Thus, instead of statically setting this to 10, we force 5 for
sanitizer builds and otherwise set it to 10 unless the user has set
CTEST_PARALLEL_LEVEL in the environment.
this is required as setting test properties on gtests is now not
possible anymore.
this seems to be unused and the directories we're pointing at do not
exist anymore.
Also, the old specfiles for OBS are not needed anymore.
this removes most of the OPENSSL_VERSION_NUMBER checks.
so we can nicely hide the detail of requiring `-lcam` on FreeBSD.
while this is not truly required nowadays, we should have it on
everything that handles dynamic loading.
@arogge arogge force-pushed the dev/arogge/master/spring-cleanup branch from f603d7c to 3f02297 Compare May 15, 2025 10:10
arogge added 5 commits May 15, 2025 12:40
we now use HAVE_GFAPI everywhere and fixed HAVE_GFAPI being actually
available, which was broken in a previous cleanup commit.
This also removes support for the legacy 2-argument version of
glfs_ftruncate().
* remove BACKEND_OBJECTS
* remove unneeded link_libraries that will be added transitively anyway
* put re-used sources into STATIC libraries
by returning the created files from bareos_configure_file() this
function could be simplified a lot.
this regularly hits OOM when built with ASAN as it runs a lot of jobs.
@arogge arogge force-pushed the dev/arogge/master/spring-cleanup branch from 3f02297 to 5e4820d Compare May 15, 2025 10:40
@BareosBot BareosBot merged commit 0cf09e8 into bareos:master May 15, 2025
@arogge arogge mentioned this pull request May 15, 2025
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants