-
Notifications
You must be signed in to change notification settings - Fork 226
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
Modern CMake #125
Open
sodevel
wants to merge
16
commits into
mz-automation:master
Choose a base branch
from
sodevel:feature/modern-cmake
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Modern CMake #125
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sodevel
force-pushed
the
feature/modern-cmake
branch
from
August 25, 2022 19:04
98567e1
to
c1c3682
Compare
sodevel
force-pushed
the
feature/modern-cmake
branch
from
January 14, 2023 00:03
a4b5336
to
4c7070a
Compare
sodevel
force-pushed
the
feature/modern-cmake
branch
from
May 10, 2023 14:00
4c7070a
to
ebfeb76
Compare
sodevel
force-pushed
the
feature/modern-cmake
branch
from
November 17, 2023 21:55
ebfeb76
to
f6c1d11
Compare
Use recommended practices and rewrite main CMake files for Modern CMake. Remove possible outdated and unused elements. Keep the library target name to stay compatible with existing CMake files of examples and tests.
Install public API headers using these sets. Remove now unneeded explicit include directory definitions.
Use the variables used by the new CMake files. Use more variables inside PkgConfig template to prevent hardcoding of path segments.
Grant the unit tests access to private components of the library.
If TLS is enabled but no local Mbedtls copy available, use FetchContent to download the required version from the official GitHub repository.
Use a postfix for the external project name.
This allows to easily disable the installation if used as subproject.
This moves the responsibility from the usage side to the definition side and the corresponding code closer to the location where the current mbedtls version is declared. In a future update only this location needs to be adapted.
Don't apply the flag in the top level file or it will also be applied to Mbed TLS.
Prevent possible name clashes when used as subproject.
This version is some patch levels newer than the one used by upstream. This version does not require fixing its usage requirements.
sodevel
force-pushed
the
feature/modern-cmake
branch
from
June 3, 2024 14:34
f6c1d11
to
946fe26
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I tried to use this library as subproject during a CMake build but this failed because the current CMake files are pre-Modern-CMake age and the library target doesn't carry the usage requirements. I wanted to fix that and ended up rewriting the main CMake files completely. I tried to stay compatible with the current variant, but i had to change some user visible aspects to follow recommended CMake practices. I also fixed some issues with the library that looked like errors to me. I did not update the CMake files of the examples and tests except two small changes to make them work with the rewritten files. I did not touch the CMake file in the
hal
directory, it references even more elements not present in the repository and is not necessary to build the library.User visible changes:
BUILD_SHARED_LIBS
and build only one library variant at a time. This seems to be the recommended way and simplifies the CMake files a lot.file-service
to public API. It looks like this should be public, an example uses this API and won't work otherwise.Internal changes:
PLATFORM_IS_BIGENDIAN
result. While the test was performed, the result was actually never used.I have tested these new CMake files on Linux only, they are working fine in all configurations and with or without Mbedtls. I couldn't test on other platforms. I also did not test CPack.