Marat Dukhan | 5e42a78 | 2017-02-10 18:10:37 -0500 | [diff] [blame] | 1 | #!/usr/bin/env python |
| 2 | |
| 3 | |
| 4 | import confu |
| 5 | parser = confu.standard_parser("FXdiv configuration script") |
| 6 | |
| 7 | |
| 8 | def main(args): |
| 9 | options = parser.parse_args(args) |
| 10 | build = confu.Build.from_options(options) |
| 11 | |
| 12 | build.export_cpath("include", ["fxdiv.h"]) |
| 13 | |
Marat Dukhan | 967a027 | 2017-02-12 01:32:06 -0500 | [diff] [blame] | 14 | with build.options(source_dir="test", deps=build.deps.googletest): |
| 15 | build.unittest("multiply-high-test", build.cxx("multiply-high.cc")) |
| 16 | build.unittest("quotient-test", build.cxx("quotient.cc")) |
| 17 | |
| 18 | with build.options(source_dir="bench", deps=build.deps.googlebenchmark): |
| 19 | build.benchmark("init-bench", build.cxx("init.cc")) |
| 20 | build.benchmark("multiply-bench", build.cxx("multiply.cc")) |
| 21 | build.benchmark("divide-bench", build.cxx("divide.cc")) |
| 22 | build.benchmark("quotient-bench", build.cxx("quotient.cc")) |
| 23 | build.benchmark("round-down-bench", build.cxx("round-down.cc")) |
Marat Dukhan | 5e42a78 | 2017-02-10 18:10:37 -0500 | [diff] [blame] | 24 | |
| 25 | return build |
| 26 | |
| 27 | |
| 28 | if __name__ == "__main__": |
| 29 | import sys |
| 30 | main(sys.argv[1:]).generate() |