Skip to content

Conditional statements

rubenvb edited this page May 22, 2011 · 2 revisions

Definition

A conditional statement is a part of a target section or list that determines if the token or section needs to be included in the build process. If the condition is at the beginning of a line, the whole line will be skipped, if it is before a curly brace, eveything in the subsection will be skipped, if it is in a list before an item, one item will be skipped. Conditions can be logically modified, by using the logical operator and: &, the logical operator or |, and the logical operator not !.

(condition)SOURCES some_conditional_source.cpp other_conditional_source.cpp
SOURCE_DIRS (windows)platform/windows (unix)platform/unix
(windows&!debug){
HEADERS windows_release_header.h
SOURCES windows_release_file.cpp }

Remarks

  • You can use conditions on target sections themselves, but only CONFIG variables that are platform and build-configuration-related. This means things like windows, gcc, debug, release, etc... Basically everything known after reading the command-line arguments passed to Ambrosia.
Clone this wiki locally