You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This repostiory contains the first version of a possible RTEMS CMake build aupport. The intention is to export the RTEMS specific configuration of the cross compiler toolchain and the flags to external `*.cmake` files so the application `CMakeLists.txt` can stay clean, similarly to the `rtems_waf` support.
3
+
This repostiory contains the first version of a possible RTEMS CMake build aupport. The intention is to provide most CMake configuration to perform cross-compiling of RTEMS applications and provide a decent starting point for developers which would like to use RTEMS. The support has been written as generic as possible.
4
+
5
+
This is still a prototype. Simple applications have been tested, but it has not been attempted to link an additional library for an application yet.
6
+
7
+
## How to use
8
+
9
+
Clone this repository. This does not necesarilly have to be in the application root path, but the RTEMS configuration path (the folder containing the `*.cmake` files) needs to be specified in this case.
This function will call the the `rtems_generic_config` function internally to set up the cross-compiler, using the provided RTEMS prefix and the BSP name,
54
+
and the RTEMS BSP (e.g. sparc/erc32) to this function.
55
+
56
+
After that, it will call the the function `rtems_hw_config` which will assign necessary compiler and linker flags to the provided target.
57
+
58
+
## Optional configuration of the CMake support
59
+
60
+
The RTEMS CMake build support can be configured either by passing configuration options prepended with `-D` to the build command or by setting these build variables in the application `CMakeLists.txt` before calling the build support. Following options are available
61
+
62
+
-`RTEMS_VERSION`: Can be specified manually. If this is not specified, the CMake build support will attempt to extract the version number from the RTEMS prefix (last letter of path). This variable needs to be valid for the RTEMS support to work!
-`RTEMS_SCAN_PKG_CONFIG`: The RTEMS CMake support will try to read the pkgconfig files to extract compile and link flag options.
65
+
-`RTEMS_TOOLS`: Can be specified if the RTEMS tools folder. Can be different from the prefix but will be equal to the prefix for most users.
66
+
-`RTEMS_PATH`: Folder containing the RTEMS installation (BSPs). Can be different from the prefix but will be equal to the prefix for most users.
67
+
68
+
## Extending the build system support
69
+
70
+
It is possible to read the pkfconfig files now, so extending the manual build configuration might not be necessary in the future.
71
+
72
+
Extending the build support is relatively easy:
73
+
74
+
Extract the necessary compiler and linker flags for the RTEMS build from the pkgconfig file
75
+
for the specific BSP. This file will generally be located inside the `lib/pkgconfig` folder of the RTEMS tools folder. Add these flags in the `RTEMSHardware.cmake` file for your specific BSP.
76
+
77
+
When building with CMake, `-v` can be added to verify the flags.
78
+
79
+
## Example
80
+
81
+
See https://github.com/rmspacefish/rtems-demo/tree/master/applications/hello for an example. This is the Hello World project taken from the RTEMS quick start guide,
82
+
but compiled using RTEMS. The repository also contains instructions on how to build the RTEMS tools if required and all specific steps to build with CMake.
0 commit comments