kitlang / kit

Kit: a magical, high performance programming language, designed for game development.
https://www.kitlang.org
Other
1.02k stars 29 forks source link

Support for toolchain definitions and cross compilation #110

Closed bendmorris closed 5 years ago

bendmorris commented 5 years ago

A toolchain is a .env file containing platform/compiler-specific configuration:

CC=gcc
CPPFLAGS="-D_GNU_SOURCE -D_BSD_SOURCE -D_DEFAULT_SOURCE"
CFLAGS="-std=c99 -pedantic -O3 -Os -Wno-missing-braces -Wno-shift-op-parentheses"

Currently they can include CC, CFLAGS, CPPFLAGS, LDFLAGS and INCLUDE_PATHS.

Invoked by using the --build (the local toolchain, used by macros) and/or --host (the target compilation toolchain) command line arguments with a toolchain name or path (e.g. linux-gcc or /path/to/linux-gcc). If --build isn't provided, it uses a system default; if --host isn't provided, it uses the same toolchain as --build.