[PATCH v2 2/4] buildtools: use macro to embed information in binaries

Dmitry Kozlyuk dmitry.kozliuk at gmail.com
Tue Apr 15 09:44:51 CEST 2025


On 15.04.2025 04:21, Andre Muezerie wrote:
> -_, tmp_root, ar, archive, output, *pmdinfogen = sys.argv
> +_, tmp_root, archiver, archive, output, *pmdinfogen = sys.argv
>   with tempfile.TemporaryDirectory(dir=tmp_root) as temp:
>       paths = []
> -    for name in subprocess.run([ar, "t", archive], stdout=subprocess.PIPE,
> +    if archiver == 'lib':
> +        archiver_options = ['/LIST', '/NOLOGO']
> +    else:
> +        archiver_options = ['t']
> +    for name in subprocess.run([archiver] + archiver_options + [archive], stdout=subprocess.PIPE,
>                                  check=True).stdout.decode().splitlines():
>           if os.path.exists(name):
>               paths.append(name)
>           else:
> -            subprocess.run([ar, "x", os.path.abspath(archive), name],
> +            subprocess.run([archiver, "x", os.path.abspath(archive), name],
>                              check=True, cwd=temp)
>               paths.append(os.path.join(temp, name))
>       subprocess.run(pmdinfogen + paths + [output], check=True)
Does `lib.exe` support `x`? Can't find this option in the doc:
https://learn.microsoft.com/en-us/cpp/build/reference/running-lib?view=msvc-170 



More information about the dev mailing list