Config and build in build_dir
(self, build_dir, cmake_args, want_install)
| 78 | ) |
| 79 | |
| 80 | def _build(self, build_dir, cmake_args, want_install): |
| 81 | """ |
| 82 | Config and build in build_dir |
| 83 | """ |
| 84 | |
| 85 | cwd = os.getcwd() |
| 86 | try: |
| 87 | if not os.path.isdir(build_dir): |
| 88 | os.makedirs(build_dir) |
| 89 | |
| 90 | os.chdir(build_dir) |
| 91 | commands = [ |
| 92 | "cmake .. -DCMAKE_BUILD_TYPE=Release" + cmake_args, |
| 93 | "cmake --build . --config Release -- -j {}".format(num_cores), |
| 94 | ] + (["cmake --build . --target install"] if want_install else []) |
| 95 | for c in commands: |
| 96 | check_call(c.split()) |
| 97 | finally: |
| 98 | os.chdir(cwd) |
| 99 | |
| 100 | def run(self): |
| 101 | self.build_third_party() |