Commit c8a3a59b by Martin Boos Committed by Tianqi Chen

use LLVM linker (#2713)

* use LLVM linker

* error message improved in case of filenotfound

* linting error fixed
parent ada760a4
......@@ -85,13 +85,13 @@ BOOL APIENTRY DllMain( HMODULE hModule,\
cl_cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
(out, _) = proc.communicate()
except FileNotFoundError:
raise RuntimeError("can not found cl.exe,"
raise RuntimeError("Can not find cl.exe,"
"please run this in Vistual Studio Command Prompt.")
if proc.returncode != 0:
msg = "Compilation error:\n"
msg += py_str(out)
raise RuntimeError(msg)
link_cmd = ["link"]
link_cmd = ["lld-link"]
link_cmd += ["-dll", "-FORCE:MULTIPLE"]
for obj in objects:
......@@ -111,8 +111,11 @@ BOOL APIENTRY DllMain( HMODULE hModule,\
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.")
raise RuntimeError("Can not find the LLVM linker for Windows (lld-link.exe)."
"Make sure it's installed"
" and the installation directory is in the %PATH% environment "
"variable. Prebuilt binaries can be found at: https://llvm.org/"
"For building the linker on your own see: https://lld.llvm.org/#build")
if proc.returncode != 0:
msg = "Compilation error:\n"
msg += py_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