(cmake_cmd)
| 292 | return result.stdout |
| 293 | |
| 294 | def run_cmake_command(cmake_cmd): |
| 295 | # NOTE: Because CMake is an exectuable that runs executables |
| 296 | # stdout/stderr are mixed together. So this combines the outputs |
| 297 | # and prints them properly in case there is a non-zero exit code. |
| 298 | result = subprocess.run(cmake_cmd, |
| 299 | stdout = subprocess.PIPE, |
| 300 | stderr = subprocess.STDOUT, |
| 301 | text = True |
| 302 | ) |
| 303 | |
| 304 | if VERBOSE: |
| 305 | print(result.stdout) |
| 306 | print(f"CMake command: {cmake_cmd} ", flush=True) |
| 307 | |
| 308 | if result.returncode != 0: |
| 309 | print(result.stdout, file=sys.stderr) |
| 310 | sys.exit(result.returncode) |
| 311 | |
| 312 | def escape(path): |
| 313 | return path.replace('\\', '/') |
no outgoing calls
no test coverage detected