forked from OctaForge/OctaBuild
add new "depend" command to specify deps
parent
7d9fac6ae0
commit
b2814ffe2f
|
@ -34,6 +34,6 @@ action test_invoke [
|
||||||
|
|
||||||
// dependencies
|
// dependencies
|
||||||
|
|
||||||
rule foo.o foo.h
|
depend foo.o foo.h
|
||||||
rule bar.o bar.h
|
depend bar.o bar.h
|
||||||
rule test.o [foo.h bar.h]
|
depend test.o [foo.h bar.h]
|
5
main.cc
5
main.cc
|
@ -444,6 +444,11 @@ int main(int argc, char **argv) {
|
||||||
((ObState &)cs).rule_add(an, nullptr, body, true);
|
((ObState &)cs).rule_add(an, nullptr, body, true);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
os.cs.add_command("depend", "ss", [](CsState &cs, const char *file,
|
||||||
|
const char *deps) {
|
||||||
|
((ObState &)cs).rule_add(file, deps, nullptr);
|
||||||
|
});
|
||||||
|
|
||||||
os.cs.add_commandn("getenv", "s", [](CsState &cs, TvalRange args) {
|
os.cs.add_commandn("getenv", "s", [](CsState &cs, TvalRange args) {
|
||||||
if (((ObState &)cs).ignore_env) {
|
if (((ObState &)cs).ignore_env) {
|
||||||
cs.result->set_cstr("");
|
cs.result->set_cstr("");
|
||||||
|
|
Loading…
Reference in New Issue