import sys
import tempfile
-_, ar, archive, output, *pmdinfogen = sys.argv
-with tempfile.TemporaryDirectory() as temp:
+_, tmp_root, ar, archive, output, *pmdinfogen = sys.argv
+with tempfile.TemporaryDirectory(dir=tmp_root) as temp:
proc = subprocess.run(
# Don't use "ar p", because its output is corrupted on Windows.
[ar, "xv", os.path.abspath(archive)], stdout=subprocess.PIPE, check=True, cwd=temp
sphinx_wrapper = py3 + files('call-sphinx-build.py')
# select library and object file format
-pmdinfo = py3 + files('gen-pmdinfo-cfile.py')
+pmdinfo = py3 + files('gen-pmdinfo-cfile.py') + [meson.current_build_dir()]
pmdinfogen = py3 + files('pmdinfogen.py')
if host_machine.system() == 'windows'
if cc.get_id() == 'gcc'