Split osal into interface library and implementation#32
Split osal into interface library and implementation#32elupus 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.
hefloryd
left a comment
There was a problem hiding this comment.
Looks good, some minor comments
|
|
||
| target_compile_definitions(${_osal_sys} | ||
| PUBLIC | ||
| "OS_MAIN=int _main" |
There was a problem hiding this comment.
Should OS_MAIN be hardcoded here?
There was a problem hiding this comment.
The definition of this is defined by the PORT rather than the common API. And port is only known at application build time. So when we link against a given port, the header will define the main symbol.
The value in the heade is only the default until a port is known. This does have bad side effect thou that if you define your main function somewhere, before linking against a port it will be wrong.
Options:
-
We could add a weak int main() symbol in the port which then calls into a standardized os_main() symbol in the application instead?
-
We always define this symbol in the port cmake for all ports.
7c0da1a to
357677c
Compare
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 - Build 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.
|
Looks good. |
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.