IrisBuild is a meta build system for cross-platform projects. Currently it was used in project Kaleido3D. We can also use it to generate Visual Studio solutions for Windows, Android and iOS project with full featured code-complete functionality.
Supported Toolchains:
- Visual Studio 2017+
- Android NDK 14+
- iOS Build Environment on Windows
- Xcode 8+
- PlayStation
- Gradle
- GN build syntax support (Google's
Generate Ninja
)- Built-in variables:
target_os
,target_arch
,target_config
- Built-in function for targets:
-
shared_library
,static_library
,executable
(include apple app bundle, game console targets) -
android_apk
- maven package downloader
- AndroidManifest merging
- apk signing
- jni compilation and packaging
-
ohos_hap
, for HUAWEI's HarmonyOS
-
- Built-in variables:
- Built-in functions:
-
zip
&unzip
-
download
&download_and_extract
-
- Supported source file types:
- asm, c, cpp, objc, objcc, ispc, swift, pssl
- java (android)
- rust
- Visual Studio Code syntax highlighter
- 2021/02/19 Updates:
- Add AndroidApk initially build support
- 2021/01/09 Updates:
- Add SwiftLang support
- 2020/11/24 Updates:
- Add PS4/5 support
- GN grammar compatible
- Add GUI support
- __file__ : str
- __root_dir__ : str
- __build_dir__ : str
- __is_build__ : bool
- __is_generate__: bool
- __ide__: str
- target_os : str
- target_arch : str
- target_config : str
- force_static_crt : bool, build for windows
- force_clang : bool, build objc for windows
- force_universal : bool, build for macOS
- platform_white_list : string_list
- configs : string_list
- output_dir : str
- precompiled_header : str
- precompiled_source : str
- visibility : string_list
- sources : string_list
- defines : string_list
- deps : string_list
- include_dirs : string_list
- lib_dirs : string_list
- libs : string_list
- ldflags : string_list
framework_dirs : string_list
, depend framework search directories.frameworks : string_list
, depend frameworks.- cflags : string_list
- clangs_cc/objc/objcc/ispc/swift/rust : string_list
- Windows
msvc.sys_incs
: string_listmsvc.cflags
: string_listmsvc.cflags_cc
: string_listmsvc.has_clang
: boolmsvc.clang.root
: strmsvc.clang.path
: strmsvc.clang.ldflags
: string_listmsvc.clang.cflags
: string_listmsvc.clang.cflags_asm
: string_listmsvc.clang.cflags_cc
: string_listmsvc.clang.cflags_objc
: string_listmsvc.clang.cflags_objcc
: string_list
- Playstation
- Both:
has_ps4_support
: bool,has_ps5_support
: bool. ps4.clang.root
: strps4.clang.path
: strps4.clang.cflags
: string_listps4.clang.cflags_asm
: string_listps4.clang.cflags_cc
: string_listps4.clang.cflags_objc
: string_listps4.clang.cflags_objcc
: string_listps5.clang.root
: strps5.clang.path
: strps5.clang.cflags
: string_listps5.clang.cflags_asm
: string_listps5.clang.cflags_cc
: string_listps5.clang.cflags_objc
: string_listps5.clang.cflags_objcc
: string_listps5.clang.ldflags
: string_list
- Both:
- Android (WIP)
android.java_home
: strandroid.sdk.home
: strandroid.ndk.home
: strandroid.clang.root
: strandroid.clang.path
: strandroid.clang.cflags
: string_listandroid.clang.cflags_asm
: string_listandroid.clang.cflags_cc
: string_listandroid.clang.cflags_objc
: string_listandroid.clang.cflags_objcc
: string_list
- iOS (WIP)
ios.build_on_windows
: boolios.clang.sysroot
: strios.clang.cflags
: string_listios.clang.cflags_cc
: string_listios.clang.cflags_objc
: string_listios.clang.cflags_objcc
: string_listios.clang.cflags_asm
: string_list
- MacOS (WIP)
macos.build_on_windows
: boolmacos.clang.sysroot
: strmacos.clang.cflags
: string_listmacos.clang.cflags_cc
: string_listmacos.clang.cflags_objc
: string_listmacos.clang.cflags_objcc
: string_listmacos.clang.cflags_asm
: string_list
- HarmonyOS (TODO)
- Linux (TODO)
- ISPC
has_ispc
: boolispc.os
: str
- Swift
- Rust
- Java
shared_library("newLibrary") {
force_static_crt = true
force_clang = false
platform_white_list = ["windows"]
output_dir = "$__build_dir__"
sources = ["main.cc"]
include_dirs = ["."]
clangs_cc = ["/O0", "/g"]
libs = ["user32.lib"]
}
variable scope
xen = {
l = [5,3]
p = "nig"
}
// xen.l : list
// xen.p : str
named scope
variable has serveral named scope
prog("xxx") {
l = [5,3]
p = "nig"
}
// prog.xxx.l : list
// prog.xxx.p : str
ret = execute("ls /") // without named arg
ret = execute(command = "ls /") // with named args
download_and_extract(predownload_url, "../temp")
execute("xbgn --build ../")
}
on_prebuild = () {
}
on_post_build = () {
pack(target)
}
static_library
(name) {scope
}shared_library
(name) {scope
}framework
(name) {scope
}resources
: string_listo_type
: str,executable
/bundle
/dynamic library
(default)/static library
executable
(name) {scope
}as_apple_app
: bool, macOS/iOS app bundle, iftarget_os
isios
, it istrue
.pack_ios_ipa
: bool, iOS specificapp_id
: str, used for bothandroid apk
andapple app
apple_plist_info
: strapple_code_sign_id
: str, code signing entity for apple appas_android_apk
: bool, for android app target (purenative
), otherwise androidelf
generated.as_ohos_hap
: bool, for Huawei'sOHOS
app
android_apk
(name) {scope
}compileSdkVersion
: intdefaultConfig
: scopeapplicationId
: strminSdkVersion
: inttargetSdkVersion
: intversionCode
: intversionName
: str
java
: scopesrcDirs
: listjarLibs
: list
resDir
: strmanifest
: strjnis
: list
- zip(file_list, root_dir, dest_file): compress file_list to single dest zip under root dir.
- unzip(src_path, dst_dir): extract zip file from source path to dest dir.
- execute(cmd) -> (code, stdout, stderr): execute command line
- download(url, file, proxy): download file to file path
- git_clone(url, dir)
source_set
config
group
download(url = "http://sss.xx/ff.zip", file = "xx.zip")
unzip("xx.zip", dest_dir)
if(var) {
echo("hello var")
}
match(target_os) {
"windows" | "ios" => {
echo("Wow~~~")
},
"ps5" => {
echo("Wow...")
}
}
for i = 0...8 {
}
for i in tests
{
// continue
}
// need parse dict
for i in [
"ss", //string
"uu" : {
"8788" : true,
"sds" : 88
} // dict
] // array
{
break
}
The Details documented in the Wiki