Hi yk,
The .camkes files can be preprocessed by the C preprocessor.
To do this, you'll need to turn on the CAmkESCPP CMake flag by appending this line to the CMakeLists.txt file for your CAmkES component:
set(CAmkESCPP ON CACHE BOOL "" FORCE)
You could then define flags inside a header file and include it into the .camkes file for your application.
For example, given a header file called main.h, add this line to the .camkes file for your application:
#include "main.h"
or similar.
Sincerely,
Damon
________________________________
From: Devel on behalf of yogidk
Sent: Sunday, 19 May 2019 4:43 AM
To: devel@sel4.systems
Subject: [seL4] How to add conditional compilation in .Camkes files
Hi,
I try to add support for UART on one platform and disable this UART for another platform.
As my application is Camkes based, I need to define the UART connections (Dataport, Interface functions etc) between the 2 Camkes components. However I need to use the same application on another platform without UART support.
How can this be got in .Camkes files ?
I already tried including a .h file where I define something like this
In main.h
#ifdef PLATFORM_X
#define UART 1
#else
#define UART 0
#endif
Then include main.h file in Camkes files using a .idl4 file . However it did not work.
.Camkes file is not able to see these defines to use it further for conditional compilation in .camkes files to enable or disable UART between the two components.
Is there any way to get it done ?
Regards
yk