Add a new platform into K.L.A.S.
K.L.A.S. is designed to support multiple platform. This is done by separating the business layer from the platform-dependant code. Hence, only platform-specific code shall be present in the platform codes.
Build tree
Before using your platform into KLAS you need to provide your sources to cmake. Follow these steps:
- Create a new folder into
platform/with the platform's name. - A new
CMakeLists.txtand the platform's sources are expected to be in that folder. - Update the parent CMakeLists
platform/CMakeLists.txtto add your new folder. - The platform's sources must implement the interfaces present in
platform/includefolder. - A script file
packager.shpresent inplatform/<platform-name>/scriptsis necessary to create the deployment package. For more information about it, please check its section below.
Compilation
First, be sure to source the environment file of your platform. The environment file should be present in the
platform's SDK you installed before and it should come with the word "environment" in the name. The resulting command
should look something like that:
source /path/to/environment-file.sh
Then, you just need to tell cmake to select the new platform by providing the cmake option
KLAS_PLATFORM=<platform-name>
cmake -DKLAS_PLATFORM=
Deployment package
A script file packager.sh present in platform/<platform-name>/scripts is necessary to create the deployment
package. This script is executed when you generate a release package archive.
You can create your own packager simply by following these steps:
- The script is executed with 4 input parameters:
- The project directory path;
- The binary directory path where the agent is located on the disk;
- The output directory path where your generated package shall be;
- The environment file path, in case you need to source it.
- Write whatever you need in this script in order to create the release package for your platform. Just keep in mind that the generated package should be in the output directory to be part of the release.