-
Notifications
You must be signed in to change notification settings - Fork 32
Split osal into interface library and implementation #32
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
base: master
Are you sure you want to change the base?
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
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, some minor comments
| #if __has_feature(attribute_analyzer_noreturn) | ||
| #define CLANG_ANALYZER_NORETURN __attribute__ ((analyzer_noreturn)) | ||
| #else | ||
| #define CLANG_ANALYZER_NORETURN |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing endif
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should OS_MAIN be hardcoded here?
| #*******************************************************************/ | ||
|
|
||
| # Get osal properties | ||
| get_target_property(OSAL_SOURCE_DIR osal SOURCE_DIR) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OSAL_SOURCE_DIR is also set by project(). Is this equivalent or if not, should a different name be used?
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.