Configurations
A configuration is a set parameters common to program, library, export and dependency definitions.
💡 Tip
All the list parameters can be set with single values, Golem makes them lists automatically if they are not.
General parameters
namestring to name the definitionWill be used as target name if
targetsis not defined.targetslist of target namesCan contain subfolders to specify where to output the final artifacts.
Multiple values is only useful when dealing with scripted builds and declaring a dependency that has to refer to multiple targets.
If unset on program and library definitions, uses the
nameparameter, otherwise finds all the targets being refered to by thenameparameter.licenseslist of licence filesUseful to let the user project retrieve the licences of all the dependencies in
build/licences.
Compilation options
defineslist of preprocessor definitions (e.g.'MY_MACRO=MY_VALUE')includeslist of include directoriesisystemlist of include directories considered as system headers from which no warning should be issued at buildsourcelist of source files (can use alternative ways to list files), expects*.cpp,*.c,*.cxx,*.ccwhen specifying a directorycflagslist of compilation flags for C filescxxflagslist of compilation flags for C++ filescppflagslist of flags added at the end of compilation commands (C and C++)program_cxxflagslist of compilation flags only effective on program definitions (C and C++), useful when defining a global configuration to use on multiple definitionslibrary_cxxflagslist of compilation flags only effective on library definitions (C and C++), useful when defining a global configuration to use on multiple definitions
Linking options
systemlist of library names to use as shared or static library depending on how the build option--linkis setliblist of shared library names to use, without prefix or extensionlibpathlist of search path for shared librariesstliblist of static library names to use, without prefix or extensionstlibpathlist of search path for static librarieslinkflagslist of link flagsldflagslist of link flags added at the end of link commandsprogram_linkflagslist of linking flags only effective on program definitions, useful when defining a global configuration to use on multiple definitionslibrary_linkflagslist of linking flags only effective on library definitions, useful when defining a global configuration to use on multiple definitionsframeworklist of frameworks (macOS)frameworkpathlist of search path for frameworks (macOS)rpathlist of paths to hard-code into the binary during linking timerpath_linklist of search paths to link libraries
Header-only libraries
header_onlybooleanTrue: no artifacts to expectFalse: artifacts to expect
Useful when exporting a library for the user target to know if has to expect artifacts or not.
Linking against other libraries
uselist of library names referring to library definitions local to the projectdepslist of dependency names referring to dependency definitions local to the project themselves referring to libraries from other projects
Qt parameters
sourcelist of source files, can include*.uiand*.rcfiles (can use alternative ways to list files), also expects*.ui,*.rcwhen specifying a directory and Qt is enabledmoclist of header files (can use alternative ways to list files), expects*.hpp,*.h,*.hxx,*.hhwhen specifying a directoryqmldirslist of directories containing QML filesfeatureslist of Qt libraries according the format ‘QT5*’ or ‘QT6*’ (e.g.'QT6CORE')
DEB package
There is an experimental command golem requirements to install all the needed DEB packages to build and develop the project. The needed packages can be described with the following parameters. This information is also used when generating a DEB package for the project.
packagelist of DEB packages required to run the target (e.g.'libssl3t64')package_devlist of DEB packages required to develop and debug the target (e.g.'libssl-dev')
Scripted builds
scriptslist of function pointers to build a program or library independantly from Golemtargetslist of targets to expect after a successfull buildtarget_decoratorslist of function pointers to decorate target names depending on the build optionsartifacts_generatorslist of function pointers to generate artifact filenames from decorated targetsartifacts_devlist of development artifacts (e.g. *.lib, *.so) to expect after a successfull buildartifacts_runlist of runtime artifacts (e.g. *.dll, *.so) to expect after a successfull build
Alternative ways to list files
Some parameters are meant to be lists of files. To not have to list them individually, these parameters can accept alternative inputs and resolve them into a list of files at runtime.
The accepted inputs are:
Files: relative or absolute paths.
Directories: recursively searches for a list of files with certain extensions expected by the parameter.
Ant Glob patterns: similar to a wildcard pattern (e.g.
'src/**/*.cpp'recursively searches source files insrc), remember that the ‘..’ sequence does not represent the parent directory.ant_glob() arguments as a tuple or dict: Can be equivalent to the single Ant Glob pattern (e.g.
{'incl': 'src/**/*.cpp'}) but allows more options to control the search.