Reversing the project's version variable flow #398

Closed
opened 2026-01-29 20:43:15 +00:00 by claunia · 1 comment
Owner

Originally created by @the-moisrex on GitHub (Oct 12, 2021).

I have some sort of question about the design of the version variables used in this library. From what I know, it's more usual to put the version number inside the CMakeLists.txt file and then use preprocessing to put it in the files like c/common/version.h not the other way around.

Currently there's this kinda CMake code in CMakeLists.txt file to do just that
image

And also not knowing the project's version number in the CMakeLists.txt's project command will cause warnings like this:
image

which btw can be fixed by this pull request that I made a few days ago; but I don't think the library versioning should be this complicated.

Originally created by @the-moisrex on GitHub (Oct 12, 2021). I have some sort of question about the design of the version variables used in this library. From what I know, it's more usual to put the version number inside the `CMakeLists.txt` file and then use preprocessing to put it in the files like `c/common/version.h` not the other way around. Currently there's this kinda CMake code in `CMakeLists.txt` file to do just that ![image](https://user-images.githubusercontent.com/12122474/137025743-80fe8122-bbfc-4987-a32c-51fb045cb309.png) And also not knowing the project's version number in the `CMakeLists.txt`'s `project` command will cause warnings like this: ![image](https://user-images.githubusercontent.com/12122474/137025893-5f6aa78a-229f-4fef-817f-15fb1f488d3d.png) which btw can be fixed by [this pull request](https://github.com/google/brotli/pull/931) that I made a few days ago; but I don't think the library versioning should be this complicated.
Author
Owner

@eustas commented on GitHub (Jan 6, 2023):

Warning supression landed.
The thing is - CMake is not the only option to build brotli. To place buld systems in equal position we decided to put version in source code.

@eustas commented on GitHub (Jan 6, 2023): Warning supression landed. The thing is - CMake is not the only option to build brotli. To place buld systems in equal position we decided to put version in source code.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/brotli#398