Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change how CMake generates version files #71316

Merged
merged 3 commits into from
Jan 31, 2024

Conversation

alef
Copy link
Contributor

@alef alef commented Jan 28, 2024

Summary

Build "Change how CMake generates version files"

Purpose of change

I've found the version.cmake was a duplicate of what done at configuration time.

Describe the solution

✅ Moved version.h and VERSION.txt generation into version.cmake.
✅ Only revwrite version.h if the version found by git is different. This is how Makefile does it
✅ In src/, use CMAKE_CURRENT_SOURCE_DIR instead of CMAKE_SOURCE_DIR/src because why not

Describe alternatives you've considered

❌ Oddly thought that making getVersionString() constexpr would have been different then a preprocessor macro 🤦‍♂️ ...

Testing

✅ Visual Studio CMake preset build
✅ MSVC Command line CMake preset build
✅ Ubuntu WSL2 command line CMake preset build

Additional context

None

alef added 2 commits January 28, 2024 17:28
This processing is now done once at configuration,
and once at build time.
@github-actions github-actions bot added Code: Build Issues regarding different builds and build environments astyled astyled PR, label is assigned by github actions json-styled JSON lint passed, label assigned by github actions labels Jan 28, 2024
@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label Jan 28, 2024
@alef alef marked this pull request as ready for review January 29, 2024 22:14
@Maleclypse Maleclypse merged commit 34ea511 into CleverRaven:master Jan 31, 2024
32 of 36 checks passed
@alef alef deleted the newversionh branch January 31, 2024 06:42
@andrei8l
Copy link
Contributor

andrei8l commented Feb 5, 2024

This broke source releases that now get HEAD-HASH-dirty (and some log spam) as their version instead of the fallback 0.I, when built with cmake. Why was this change needed anyway?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions Code: Build Issues regarding different builds and build environments json-styled JSON lint passed, label assigned by github actions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants