Initialize a C++ build directory. The build command creates a directory initialized with Arrow's cpp source cmake and configuration. It can also optionally invoke the generator to test the build (and used in scripts). Note that archery will carry the caller environment. It will al
(ctx, src, build_dir, force, targets, **kwargs)
| 233 | @click.argument("build_dir", type=build_dir_type) |
| 234 | @click.pass_context |
| 235 | def build(ctx, src, build_dir, force, targets, **kwargs): |
| 236 | """ Initialize a C++ build directory. |
| 237 | |
| 238 | The build command creates a directory initialized with Arrow's cpp source |
| 239 | cmake and configuration. It can also optionally invoke the generator to |
| 240 | test the build (and used in scripts). |
| 241 | |
| 242 | Note that archery will carry the caller environment. It will also not touch |
| 243 | an existing directory, one must use the `--force` option to remove the |
| 244 | existing directory. |
| 245 | |
| 246 | Examples: |
| 247 | |
| 248 | \b |
| 249 | # Initialize build with clang8 and avx2 support in directory `clang8-build` |
| 250 | \b |
| 251 | archery build --cc=clang-8 --cxx=clang++-8 --cxx-flags=-mavx2 clang8-build |
| 252 | |
| 253 | \b |
| 254 | # Builds and run test |
| 255 | archery build --targets=all --targets=test build |
| 256 | """ |
| 257 | # Arrow's cpp cmake configuration |
| 258 | conf = CppConfiguration(**kwargs) |
| 259 | # This is a closure around cmake invocation, e.g. calling `def.build()` |
| 260 | # yields a directory ready to be run with the generator |
| 261 | cmake_def = CppCMakeDefinition(src.cpp, conf) |
| 262 | # Create build directory |
| 263 | build = cmake_def.build(build_dir, force=force) |
| 264 | |
| 265 | for target in targets: |
| 266 | build.run(target) |
| 267 | |
| 268 | |
| 269 | def _flatten_numpydoc_rules(rules): |