Skip to content

Commit

Permalink
wip: Attempt to fix Windows/Cygwin with version suffix
Browse files Browse the repository at this point in the history
  • Loading branch information
dcbaker committed Jan 13, 2025
1 parent 6cac356 commit e824a3e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion mesonbuild/dependencies/dev.py
Original file line number Diff line number Diff line change
Expand Up @@ -601,10 +601,15 @@ def __init__(self, name: str, env: Environment, kwargs: T.Dict[str, T.Any], lang

libtype = mesonlib.LibType.PREFER_STATIC if self.static else mesonlib.LibType.PREFER_SHARED

for search in dirs:
# Sometimes (especially on Windows), the libs will have a suffix of the
# major version, so thigs like `clangBasic-8.lib` or
# `cygclangBasic-8.dll`
assert llvm.version is not None, 'for mypy'
for search, suffix in zip(dirs, ['', f'-{llvm.version.split(".")[0]}']):
self.module_details.clear()
libs: T.List[str] = []
for m in modules:
m = f'{m}{suffix}'
lib = self.clib_compiler.find_library(m, env, search, libtype)
if lib:
libs.extend(lib)
Expand All @@ -619,6 +624,7 @@ def __init__(self, name: str, env: Environment, kwargs: T.Dict[str, T.Any], lang
continue

for m in opt_modules:
m = f'{m}{suffix}'
lib = self.clib_compiler.find_library(m, env, search, libtype)
if lib:
libs.extend(lib)
Expand Down

0 comments on commit e824a3e

Please sign in to comment.