This diff was generated by the following script:
#!/usr/bin/env python3
import os, subprocess
r = subprocess.run('git show --pretty='' --name-only f09cf34d00'.split(),
stdout=subprocess.PIPE, text=True)
for line in r.stdout.splitlines():
if not line.endswith('CMakeLists.txt'): continue
gn = 'llvm/utils/gn/secondary/' + os.path.dirname(line) + '/BUILD.gn'
if not os.path.exists(gn): continue
with open(gn) as f:
contents = f.read()
if contents.count('"//llvm/lib/Support",') == 1:
contents = contents.replace(
'"//llvm/lib/Support",',
'"//llvm/lib/Support", "//llvm/lib/TargetParser",')
elif contents.count(' deps = [') == 1:
contents = contents.replace(
' deps = [',
' deps = [ "//llvm/lib/TargetParser",')
else:
print('needs manual fixup:', gn)
continue
with open(gn, 'w') as f:
f.write(contents)
I then manually fixed up the BUILD.gn files for Support (should not depend on
TargetParser) and TargetParser (should depend on Support) and ran `gn format`
on all touched files.
This is enough to get the lit-based tests to pass on macOS.
Doesn't yet add build targets for:
- Any LLDB unit tests
- swig bindings
- various targets not needed by lit tests
LLDB has many dependency cycles, something GN doesn't allow. For
that reason, I've omitted some dependency edges. Hopefully we can
clean up the cycles one day.
LLDB has a public/private header distinction, but mostly ignores it.
Many libraries include private headers from other modules.
Since LLDB is the first target the LLVM/GN build that uses Objective-C++
code, add some machinery to the toolchain file to handle that.
Differential Revision: https://reviews.llvm.org/D109185