Glossary · Automation software engineering and architecture
Compile-time configuration
Also known as: Build-time configuration, Conditional compilation
German: Konfiguration zur Übersetzungszeit
In software engineering, compile-time configuration is the selection of software features, parameters or variants when the source code is compiled, for example through preprocessor symbols, compiler switches or conditional compilation, so the resulting binary contains only the chosen options and they cannot be changed without rebuilding.
- Software engineering
In one sentence
Compile-time configuration selects features and parameters when code is compiled, so they cannot change without a rebuild.
Example
A compile-time switch includes the optional second conveyor axis in the firmware; machines without the axis get a binary without that code.
How it applies
- Engineering: Compile-time configuration saves memory and execution time and removes unused code, which is useful on small embedded targets. It also multiplies the number of distinct binaries that must be built and tested.
- Verification: Each combination of compile-time options is, strictly speaking, a different program. Define which combinations are supported and make sure they are all built and tested.
- Documentation: Release documentation should list the compile-time options used for each delivered binary. If options change user-visible features, the documentation team must know which variant a manual describes, and service staff must be able to identify the variant on the device.
Compile-time vs. runtime configuration
Runtime configuration, through a Configuration file, Configuration parameter or Feature flag, can be changed after deployment. Compile-time configuration cannot. Use compile-time options for things that are genuinely fixed per hardware variant, and runtime configuration for what customers or service staff need to adjust.