Split osal into interface library and implementation#32
Draft
elupus wants to merge 4 commits intortlabs-com:masterfrom
Draft
Split osal into interface library and implementation#32elupus wants to merge 4 commits intortlabs-com:masterfrom
elupus wants to merge 4 commits intortlabs-com:masterfrom
Conversation
8d30800 to
e2a49e5
Compare
os_log is a global function pointer to allow redirecting logging to other targets since a while back. Freertos port should support this.
Not all ports set compile options on the files, so we should support empty lists on all of these files.
Instead of making this choice compile time, install all supported compiler headers by default.
Expose a osal-interface target that is of cmake INTERFACE type. This target only defines the osal API and allow delaying the choice of linking of final osal port implementation to the link stage of the binary. This allow the Osal implementation to be defined by the integrator of used libraries. To accomplish this: - osal.h becomes static and common to all targets - osal_sys.h is changed to an internal implementation header for the osal port - Buld files are restructured to keep build configuration of a port in the port directory By default an osal cmake alias is added to remain compatible with previous solutions.
hefloryd
reviewed
Dec 29, 2025
Contributor
hefloryd
left a comment
There was a problem hiding this comment.
Looks good, some minor comments
| #if __has_feature(attribute_analyzer_noreturn) | ||
| #define CLANG_ANALYZER_NORETURN __attribute__ ((analyzer_noreturn)) | ||
| #else | ||
| #define CLANG_ANALYZER_NORETURN |
Contributor
There was a problem hiding this comment.
This file could probably be shared between gcc/clang using the previous checks for clang
|
|
||
| target_compile_definitions(${_osal_sys} | ||
| PUBLIC | ||
| "OS_MAIN=int _main" |
Contributor
There was a problem hiding this comment.
Should OS_MAIN be hardcoded here?
| #*******************************************************************/ | ||
|
|
||
| # Get osal properties | ||
| get_target_property(OSAL_SOURCE_DIR osal SOURCE_DIR) |
Contributor
There was a problem hiding this comment.
OSAL_SOURCE_DIR is also set by project(). Is this equivalent or if not, should a different name be used?
This file contains hidden or 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
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.
Expose a osal-interface target that is of cmake INTERFACE type. This target only defines the osal API and allow delaying the choice of linking of final osal port implementation to the link stage of the binary. This allow the Osal implementation to be defined by the integrator of used libraries.
To accomplish this:
By default an osal cmake alias is added to remain compatible with previous solutions.