The project's compilers can be specified via the compiler_all
, compiler_c_cpp
, compiler_c
, compiler_cpp
and compiler_asm
properties, with more specific flags taking precedence.
Currently supported compilers are:
- GCC/G++ for C/C++/ASM with
gcc
- clang/clang++ for C/C++/ASM with
clang
- GAS for ASM with
as
- NASM for ASM with
nasm
The project's linker can be specified via the linker
property.
Currently supported linkers are:
- GCC/G++ with
gcc
- clang/clang++ with
clang
- ld with
ld
- ld.gold with
ld.gold
- ld.lld with
ld.lld
- ar with
ar
- llvm-ar with
llvm-ar
project_name
: The name that will be shown when buildingtargets
: List of the targets for the projectworking_folder
: REQUIRED The folder where the build files will be stored.project_binary
: REQUIRED Output binary for the project, without extensionbinary_folder_override
: Override output folder for binary (fromworking_folder\arch\target\bin
) to thisproject_ext
: Override extension (from.exe
on windows and empty on linux) to thissrc_folder
: REUQIRED only if sources are in a different folder than cwdnoarch
: if true don't separate built files per architecture, default falsetargets_default
: default target or default targets, the targets that will be built if no targets are specified in the command-line, defaultall
compiler_binary_override_c
,compiler_binary_override_cpp
,compiler_binary_override_c_cpp
,compiler_binary_override_asm
,compiler_binary_override_all
: change the binary that is executed when calling the compilerlinker_binary_override_c
,linker_binary_override_cpp
,linker_binary_override_c_cpp
,linker_binary_override_other
,linker_binary_override_all
: change the binary that is executed when calling the linker
A source file/folder can be either a string or a source object. If is an object, the properties are:
name
: file/foldertype
: ignored if file, can beexclude
(orblacklist
),include
(orwhitelist
),include_folders_exclude_files
(orfolder_whitelist_file_blacklist
/exclude_files_include_folders
/file_blacklist_folder_whitelist
).exclude_list
orblacklist
: array of strings (files/folders) to be ignoredinclude_list
orwhitelist
: array of sources (files/folders) to be included
The target will inherit the properties of any other targets specified in the includes
property.
To specify an include switch, a JSON Object must be used as an include target, instead of a string.
It must have a type
property with the value of switch
, a valid condition
property, and a cases
property, which defines which specific target to include based on the value of the condition.
Supported conditions are:
platform
: The platform that the target is being built for.
Example:
"include":[
"common_all",
{
"type":"switch",
"condition":"platform",
"cases":{
"linux":"common_linux",
"windows":"common_windows"
}
}
]
A target group can be specified instead of a target in targets
by using the target_group
property, which is a list of the names of targets/other target groups which are included by the group.
Example:
"targets":[
"my_target_01":{
},
"my_target_02":{
},
"my_target_group":{
"target_group":[
"my_target_01",
"my_target_02",
]
}
]
The flags_*
properties speficy the flags to be passed to the compilers, each string in the array will be passed as a single argument, no manual escaping is necessary.
The available properties are flags_all
, flags_c_cpp
, flags_c
, flags_cpp
and flags_asm
. All applicable properties will be passed to the compilers, for example, the C compiler will receive all flags from flags_all
, flags_c_cpp
and flags_c
.
The defines_*
properties speficy the defines to be passed to the compilers, the defines will be converted to the format the compiler accepts, for example, a defines_all
of DEBUG
will be passed to the C compiler as -DDEBUG
and to GAS as --defsym DEBUG=1
.
Same as with flags, the available properties are defines_all
, defines_c_cpp
, defines_c
, defines_cpp
and defines_asm
.
The linker_flags
property speficies the flags to be passed to the linker, each string in the array will be passed as a single argument, no manual escaping is necessary.
The linker_libs
property speficies the libraries to be passed to the linker, will be passed as-is, like linker_flags
.
The linker_order
property specifies exceptions to the default linking order, positive weights means it will be linked after all other files, and negative weights means it will be linked before all other files.
It has 3 types:
normal
(the default) will try to match only the filename of the object file;full_path
will try to match the full path (ex. if you want to linksrc/foo/foo.cpp
before all else you'd writefoo.cpp.o
as the name ifnormal
, andsrc/foo/foo.cpp.o
iffull_path
)extra
just appends the specified file path to the object file list.
include_only
: will not allow the target to be compiled by itself, only included by other targetsbinary_folder_override
: override output folder for binary (fromworking_folder\arch\target\bin
) to this for targetproject_binary_override
: overrideproject_binary
property for the targettarget_folder_override
: override the folder where the target's output files (obj/bin/etc) will be stored, if the folder is already another target, don't forget to specifyproject_binary_override
to prevent overwriting the output executablecompiler_driver_override_c
,compiler_driver_override_cpp
,compiler_driver_override_asm
,compiler_driver_override_all
,linker_driver_override
: override project's compiler/linker propertiescompiler_binary_override_c
,compiler_binary_override_cpp
,compiler_binary_override_c_cpp
,compiler_binary_override_asm
,compiler_binary_override_all
: change the binary that is executed when calling the compilerlinker_binary_override_c
,linker_binary_override_cpp
,linker_binary_override_c_cpp
,linker_binary_override_other
,linker_binary_override_all
: change the binary that is executed when calling the linker