![]() |
OpenMake Meister |
In the Build Method, a list of available compilers must be defined to the process by an array called "@CompilersPassedInFlags". In addition, a $DefaultCompiler must be named. For example:
@CompilersPassedInFlags = qw( cc, xlc );
$DefaultCompiler = "cc";
The GetCompiler function parses the debug or release compiler flags and compiler names. The debug and release compiler flags and the compiler name are passed from the pre-defined variables that om has generated in the initialization section of the Target specific batch file. GetCompiler first determines if the build is running in Debug or Release Mode. It then searches through the flags looking for the compilers listed in the @CompilersPassedInFlags variable. It extracts the compiler name from the compiler flags and returns the compiler name via the $Compiler variable and compiler flags via the $CompilerFlags variable. If there is no match to a compiler name, the $DefaultCompiler is returned.
This function is normally used when a Build Method can support multiple compilers. For example, on Unix, it would allow gcc and g++ to be handled by the same Build Method.
USAGE:
($Compiler, $CompilerFlags)=
GetCompiler($DebugFlags,$ReleaseFlags,$DefaultCompiler,
@CompilersPassedInFlags);
RETURNS:
($Compiler, $CompilerFlags)
$Compiler is the full path to the found compiler.
$Flags is the compiler flag string minus the found compiler.
For Java subtasks, see GetFlag.