From 2152522277ee38633df5f36ac93d3ea5cf316c32 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 3 Mar 2017 15:47:47 +0200 Subject: Rework build2 cli compilation --- build/root.build | 10 ++-------- cli/buildfile | 12 ++++++------ examples/features/buildfile | 6 ++---- examples/file/buildfile | 7 ++----- examples/hello/buildfile | 6 ++---- tests/ctor/buildfile | 6 ++---- tests/erase/buildfile | 6 ++---- tests/file/buildfile | 7 ++----- tests/inheritance/buildfile | 7 ++----- tests/specifier/buildfile | 7 ++----- 10 files changed, 24 insertions(+), 50 deletions(-) diff --git a/build/root.build b/build/root.build index 719b1b8..ee1272a 100644 --- a/build/root.build +++ b/build/root.build @@ -16,17 +16,11 @@ cxx.poptions =+ "-I$out_root" "-I$src_root" # Load the cli module but only if it's available. This way a distribution # that includes pre-generated files can be built without installing cli. # This is also the reason why we need to explicitly spell out individual -# source files instead of using the cli.cxx{} group (it won't be there -# unless the module is configured). +# source file prerequisites instead of using the cli.cxx{} group (it won't +# be there unless the module is configured). # using? cli -if! $cli.configured -{ - define cli: file - cli{*}: extension = cli -} - # Specify the test target for cross-testing. # test.target = $cxx.target diff --git a/cli/buildfile b/cli/buildfile index cd19583..9ddc880 100644 --- a/cli/buildfile +++ b/cli/buildfile @@ -43,15 +43,15 @@ traversal/{hxx cxx}{ unit } \ # Generated options parser. # -{hxx ixx cxx}{options}: cli{options} - if $cli.configured { + cli.cxx{options}: cli{options} + cli.options += -I $src_root --include-with-brackets --include-prefix cli \ --guard-prefix CLI --generate-file-scanner --generate-specifier \ --reserved-name stdout -} -# Include generated cli files into the distribution. -# -{hxx ixx cxx}{options}: dist = true + # Include generated cli files into the distribution. + # + cli.cxx{*}: dist = true +} diff --git a/examples/features/buildfile b/examples/features/buildfile index c3b7913..ea8feee 100644 --- a/examples/features/buildfile +++ b/examples/features/buildfile @@ -2,10 +2,8 @@ # copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : MIT; see accompanying LICENSE file -exe{driver}: cxx{driver} {hxx ixx cxx}{options} doc{README} +exe{driver}: cxx{driver} cli.cxx{options} doc{README} cxx.poptions =+ "-I$out_base" -# Generated options parser. -# -{hxx ixx cxx}{options}: cli{options} +cli.cxx{options}: cli{options} diff --git a/examples/file/buildfile b/examples/file/buildfile index 8517a0c..7ae55df 100644 --- a/examples/file/buildfile +++ b/examples/file/buildfile @@ -2,13 +2,10 @@ # copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : MIT; see accompanying LICENSE file -exe{driver}: cxx{driver} {hxx ixx cxx}{options} doc{README} file{test.ops} +exe{driver}: cxx{driver} cli.cxx{options} doc{README} file{test.ops} exe{driver}: test.arguments = --options-file $src_base/test.ops cxx.poptions =+ "-I$out_base" -# Generated options parser. -# -{hxx ixx cxx}{options}: cli{options} - +cli.cxx{options}: cli{options} cli.options = --generate-file-scanner diff --git a/examples/hello/buildfile b/examples/hello/buildfile index 94d94eb..9991aa9 100644 --- a/examples/hello/buildfile +++ b/examples/hello/buildfile @@ -2,11 +2,9 @@ # copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : MIT; see accompanying LICENSE file -exe{driver}: cxx{driver} {hxx ixx cxx}{hello} doc{README} +exe{driver}: cxx{driver} cli.cxx{hello} doc{README} exe{driver}: test.arguments = --greeting Hi John Jane cxx.poptions =+ "-I$out_base" -# Generated options parser. -# -{hxx ixx cxx}{hello}: cli{hello} +cli.cxx{hello}: cli{hello} diff --git a/tests/ctor/buildfile b/tests/ctor/buildfile index 83e2bbe..68ea10e 100644 --- a/tests/ctor/buildfile +++ b/tests/ctor/buildfile @@ -2,10 +2,8 @@ # copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : MIT; see accompanying LICENSE file -exe{driver}: cxx{driver} {hxx ixx cxx}{test} +exe{driver}: cxx{driver} cli.cxx{test} cxx.poptions =+ "-I$out_base" -# Generated options parser. -# -{hxx ixx cxx}{test}: cli{test} +cli.cxx{test}: cli{test} diff --git a/tests/erase/buildfile b/tests/erase/buildfile index 6030372..fb58d5a 100644 --- a/tests/erase/buildfile +++ b/tests/erase/buildfile @@ -2,11 +2,9 @@ # copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : MIT; see accompanying LICENSE file -exe{driver}: cxx{driver} {hxx ixx cxx}{test} +exe{driver}: cxx{driver} cli.cxx{test} exe{driver}: test.arguments = foo -a bar -b 123 --arg -- -b 234 cxx.poptions =+ "-I$out_base" -# Generated options parser. -# -{hxx ixx cxx}{test}: cli{test} +cli.cxx{test}: cli{test} diff --git a/tests/file/buildfile b/tests/file/buildfile index 8183d79..45ba0c6 100644 --- a/tests/file/buildfile +++ b/tests/file/buildfile @@ -2,12 +2,9 @@ # copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : MIT; see accompanying LICENSE file -exe{driver}: cxx{driver} {hxx ixx cxx}{test} test{testscript} +exe{driver}: cxx{driver} cli.cxx{test} test{testscript} cxx.poptions =+ "-I$out_base" -# Generated options parser. -# -{hxx ixx cxx}{test}: cli{test} - +cli.cxx{test}: cli{test} cli.options = --generate-file-scanner diff --git a/tests/inheritance/buildfile b/tests/inheritance/buildfile index a0a2e8b..baade2d 100644 --- a/tests/inheritance/buildfile +++ b/tests/inheritance/buildfile @@ -2,14 +2,11 @@ # copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : MIT; see accompanying LICENSE file -exe{driver}: cxx{driver} {hxx ixx cxx}{test} +exe{driver}: cxx{driver} cli.cxx{test} exe{driver}: test.arguments = --very-long-flag -s short -i 123 --string long exe{driver}: test.output = test.std cxx.poptions =+ "-I$out_base" -# Generated options parser. -# -{hxx ixx cxx}{test}: cli{test} - +cli.cxx{test}: cli{test} cli.options = --generate-description --option-length 17 diff --git a/tests/specifier/buildfile b/tests/specifier/buildfile index fdba651..364792c 100644 --- a/tests/specifier/buildfile +++ b/tests/specifier/buildfile @@ -2,13 +2,10 @@ # copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : MIT; see accompanying LICENSE file -exe{driver}: cxx{driver} {hxx ixx cxx}{test} +exe{driver}: cxx{driver} cli.cxx{test} exe{driver}: test.arguments = -a -c foo cxx.poptions =+ "-I$out_base" -# Generated options parser. -# -{hxx ixx cxx}{test}: cli{test} - +cli.cxx{test}: cli{test} cli.options = --generate-specifier --generate-modifier -- cgit v1.1