autovala
autovala copied to clipboard
Conditional compilation
Currently it is not possible to have conditional compilation with CMake style expressions. This doesnot allow for very important system checking (Linux, Windows or OSX). For example I cannot have if (CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux")
in my avprj. This is interpreted wrongly. I suggest that you leave expressions in parentheses as is instead of tokenizing them. Also is there any alternative way of currently doing it. As vala only supports boolean macro variables, I tried to do this if and add compile options (-D PLATFORM_LINUX
) inside it
I also tried making a custom cmake list file which set the variables PLATFORM_LINUX
, PLATFORM_WINDOWS
and PLATFORM_OSX
and tried to include that file but I didnot exactly understand what happens on including the cmake file. The project cmake file is overwritten then.
If you want to include extra CMAKE files, you must use the include
statement in the .avprj file, pointing to a file not called CMakeFile.txt, with all your extra commands.
About the first comment, I'm not sure that it would be possible. I'll evaluate it.
Anyway, another possibility is to modify the base scripts, to simplify using autovala on non-linux platforms. It is true that I designed it mainly to be used with linux, but automatizing the system for other platforms would be a good idea...