Skip to content

Instantly share code, notes, and snippets.

@IngwiePhoenix
Created December 3, 2018 15:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save IngwiePhoenix/51599f088a00fb9657068392c16573c8 to your computer and use it in GitHub Desktop.
Save IngwiePhoenix/51599f088a00fb9657068392c16573c8 to your computer and use it in GitHub Desktop.
IceTea concept in Wren
import "Toolchains/Native" for Native
import "FLTK" for libfltk
import "Detector/CC" for CC_Detector
namespace("IngwiePhoenix") {|ns|
// @var ns: Current namespace object. Can be omitted.
Native.executable("MyApp") {|t|
// @var t: Current target
// "@" reffers to the current build script
t.input = ["@/src/*.cpp"]
// Add dependencies
t.needs(libfltk)
t.needs("/SomeTarget") // Resolved from root
tneeds("util") // Target relative to current ns.
t.on("configure") {
var cc = CC_Detector()
cc.configHeader = t.buildPath(
t.tmpDir, "config.h"
)
cc.hasHeader([
// Pass array to check many
"stdio.h",
"stdbool.h",
"unistd.h",
"windows.h"
])
cc.hasType({
// Definition: type = header/s or nothing
"uint32_t": "stdint.h",
"uint32_t",
"uint64_t": "stdint.h",
"uint64_t"
})
// Returns true after writing headers and such.
return cc.done()
}
t.settings += {
// using += matches the object
// native is an abstraction for any "native" language.
native: {
includeDirs: [t.tmpDir],
defines: {
"DEBUG": !!_ENV["DEBUG"]
}
}
}
}
action("default") {
// default action will run when user runs program in same folder as
// build description.
build(["MyApp"])
clean(["MyApp"])
install(["MyApp"])
}
// Alternative:
action("default") {
all("MyApp")
}
// Or:
action("default", "MyApp")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment