about summary refs log tree commit diff stats
path: root/setup.py
diff options
context:
space:
mode:
authorDuncan Ogilvie <mr.exodia.tpodt@gmail.com>2022-10-14 13:13:34 +0200
committerDuncan Ogilvie <mr.exodia.tpodt@gmail.com>2022-10-14 13:13:34 +0200
commit458b98b28d059c81638d7642ebbb7f476a781432 (patch)
treeb0b90b3953556f1bc7519d5c178eeadffed89eb6 /setup.py
parentc76516b37d602a3d93d1b038529337fce351da06 (diff)
downloadfocaccia-miasm-458b98b28d059c81638d7642ebbb7f476a781432.tar.gz
focaccia-miasm-458b98b28d059c81638d7642ebbb7f476a781432.zip
Allow building on Windows without a Visual Studio command prompt
This still requires you have Visual Studio and LLVM installed, but might prevent some issues like #1404
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/setup.py b/setup.py
index 52fc6f0a..22855492 100644
--- a/setup.py
+++ b/setup.py
@@ -47,7 +47,7 @@ def win_get_llvm_reg():
     except FileNotFoundError:
       pass
     return winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, REG_PATH, 0, winreg.KEY_READ)
-  
+
 def win_find_clang_path():
     try:
         with win_get_llvm_reg() as rkey:
@@ -60,6 +60,8 @@ def win_use_clang():
     # the msbuild-bin directory. Thus, we need to
     # * copy-paste bin/clang-cl.exe into a temporary directory
     # * rename it to cl.exe
+    # * copy-paste bin/lld-link.exe into a temporary directory
+    # * rename it to link.exe
     # * add that path first in %Path%
     # * clean this mess on exit
     # We could use the build directory created by distutils for this, but it
@@ -70,6 +72,7 @@ def win_use_clang():
         return False
     tmpdir = tempfile.mkdtemp(prefix="llvm")
     copyfile(os.path.join(clang_path, "bin", "clang-cl.exe"), os.path.join(tmpdir, "cl.exe"))
+    copyfile(os.path.join(clang_path, "bin", "lld-link.exe"), os.path.join(tmpdir, "link.exe"))
     os.environ['Path'] = "%s;%s" % (tmpdir, os.environ["Path"])
     atexit.register(lambda dir_: rmtree(dir_), tmpdir)