Commit 69759c0c by Hu Shiwen Committed by Tianqi Chen

add friendly tips when not found cl and link (#574)

* add friendly tips when not found cl and link

* fix lint
parent 1791b121
......@@ -79,10 +79,13 @@ BOOL APIENTRY DllMain( HMODULE hModule,\
temp_path = dllmain_path.replace("dllmain.cc", "")
cl_cmd += ["-Fo:" + temp_path]
try:
proc = subprocess.Popen(
cl_cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
(out, _) = proc.communicate()
except FileNotFoundError:
raise RuntimeError("can not found cl.exe,"
"please run this in Vistual Studio Command Prompt.")
if proc.returncode != 0:
msg = "Compilation error:\n"
msg += str(out)
......@@ -102,9 +105,13 @@ BOOL APIENTRY DllMain( HMODULE hModule,\
link_cmd += [temp_path + "dllmain.obj"]
link_cmd += ["-out:" + output]
try:
proc = subprocess.Popen(
link_cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
(out, _) = proc.communicate()
except FileNotFoundError:
raise RuntimeError("can not found link.exe,"
"please run this in Vistual Studio Command Prompt.")
if proc.returncode != 0:
msg = "Compilation error:\n"
msg += str(out)
......
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