Commit 233f10ae authored by Adam Simpkins's avatar Adam Simpkins Committed by Facebook Github Bot

improve run_cmake.py on Windows

Summary:
Update the generated `run_cmake.py` script to use `subprocess.run()` instead
of `os.execve()`.  The `os.execve()` call doesn't really do what we want on
Windows: this causes the script to exit while CMake is still running,
resulting in confusing output.  During the build step it also did not work
correctly with `vcvarsall.bat`, and using `subprocess` also solves this.

Reviewed By: wez

Differential Revision: D17493897

fbshipit-source-id: e0477627fc1824b0efcb1fa5a782d207853bcae8
parent 5dec9568
...@@ -202,7 +202,8 @@ class CMakeBuilder(BuilderBase): ...@@ -202,7 +202,8 @@ class CMakeBuilder(BuilderBase):
from __future__ import absolute_import, division, print_function, unicode_literals from __future__ import absolute_import, division, print_function, unicode_literals
import argparse import argparse
import os import subprocess
import sys
CMAKE = {cmake!r} CMAKE = {cmake!r}
SRC_DIR = {src_dir!r} SRC_DIR = {src_dir!r}
...@@ -268,8 +269,8 @@ def main(): ...@@ -268,8 +269,8 @@ def main():
cmd_str = " ".join(full_cmd) cmd_str = " ".join(full_cmd)
print("Running: %r" % (cmd_str,)) print("Running: %r" % (cmd_str,))
os.chdir(BUILD_DIR) proc = subprocess.run(full_cmd, env=env, cwd=BUILD_DIR)
os.execve(CMAKE, full_cmd, env) sys.exit(proc.returncode)
if __name__ == "__main__": if __name__ == "__main__":
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment