Skip to content
Chris White edited this page Oct 4, 2013 · 7 revisions

MixDown has the option to use override groups to set defines in the project. Override groups can be initially generated with the command line option "--profile". This will scan your computer for known compilers (GNU, Intel, Pathscale, and Portland Group) and generate initial compiler and optimization flag groups.

Override group's basic syntax is as follows:

<Name>[, <Name>]* {
    <Define Name> = <Define Value>
    <Another Define Name> = <Another Define Value>
}

An override group must have at least one name but there is no limit to how many comma delimited names they can have.

A basic override group file will may look like this:

/usr/bin/GNU {
    ccompiler = /usr/bin/gcc
    objccpreprocessor = /usr/bin/cpp
    cxxcompiler = /usr/bin/g++
    objcxxpreprocessor = /usr/bin/cpp
    cpreprocessor = /usr/bin/cpp
}

/usr/bin/GNU, debug {
    cxxflags = -g -O0 -Wall
    cppflags = -Wall
    cflags = -g -O0 -Wall
}

/usr/bin/GNU, release {
    cxxflags = -O2 -Wall
    cppflags = -Wall
    cflags = -O2 -Wall
}

After Override Groups have been defined. You can use them in the project file like any other MixDown define, $(define_name). For example, a build line with defines in it may look like:

Build: $(cxxcompiler) $(cxxflags) main.cpp

On the command line, you can chose which override groups to use. For example if you use "-g/usr/bin/GNU,debug", the previous build line will be expanded to:

Build: /usr/bin/g++ -g -O0 -Wall main.cpp

But if you use "-g/usr/bin/GNU,release":

Build: /usr/bin/g++ -O2 -Wall main.cpp

Override Group combination

Override Groups are combined in a specified manner. Shortest names are applied first with the longer named groups overriding values in the shorter groups. Using the following groups:

A {
   Foo = AFooValue
   Bar = ABarValue
}

A, B {
   Bar = BBarValue
}

A, B, C {
   Foo = CFooValue
}

Choosing "A", results in:

Foo = AFooValue
Bar = ABarValue

Choosing "A, B", results in:

Foo = AFooValue
Bar = BBarValue

Choosing "A, B, C", results in:

Foo = CFooValue
Bar = BBarValue