autovala icon indicating copy to clipboard operation
autovala copied to clipboard

Conditional compilation

Open meghprkh opened this issue 8 years ago • 3 comments

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

meghprkh avatar Jun 14 '16 18:06 meghprkh

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.

meghprkh avatar Jun 14 '16 18:06 meghprkh

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.

rastersoft avatar Jun 14 '16 23:06 rastersoft

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...

rastersoft avatar Jun 15 '16 20:06 rastersoft