[PATCH] D22987: [lldb][cmake] Remove libclang as an lldbBase dependency (NFCI)

Zachary Turner via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 2 11:57:20 PDT 2016


zturner requested changes to this revision.
zturner added a comment.
This revision now requires changes to proceed.

In https://reviews.llvm.org/D22987#503639, @vsk wrote:

> I can't find any #includes of headers installed by the 'install-clang-headers'
>  target in lldb, and 'check-lldb' seems to pass without adding in a clang-tblgen
>  dependency.
>
> There could be a 'gotcha' here if there's some library we're not building along
>  with 'check-lldb' or 'lldb'. This doesn't seem likely, but if it happens, we
>  can go back and add an 'install-clang-headers' dependency for the affected
>  library.
>
> For now, I don't think we need to add a 'clang-tblgen' dependency.


`check-lldb` isn't the problem so as much as simply guaranteeing that the clang headers are auto-generated *before* we compile any part of LLDB that attempts to `#include` them.  I don't know what the exact right target is to build in this case, but we need a way to ensure that headers are auto-generated before compiling a library that `#includes` those headers.

In fact, I just did a clean build with the patch and got errors:

- Build files have been written to: D:/src/llvmbuild/ninja

[368/2856] Building CXX object tools\lldb\source\Commands\CMakeFiles\lldbCommands.dir\CommandObjectMemory.cpp.obj
FAILED: C:\PROGRA~2\MICROS~1.0\VC\bin\AMD64_~2\cl.exe   /nologo /TP -DGTEST_HAS_RTTI=0 -DLLDB_DISABLE_CURSES -DLLDB_DISABLE_LIBEDIT -DLLDB_PYTHON_HOME=\"C:/Python35\" -DUNICODE -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -D_FILE_OFFSET_BITS=64 -D_HAS_EXCEPTIONS=0 -D_LARGEFILE_SOURCE -D_SCL_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS -D_UNICODE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Itools\lldb\source\Commands -ID:\src\llvm\tools\lldb\source\Commands -ID:\src\llvm\tools\lldb\include -Itools\lldb\include -Iinclude -ID:\src\llvm\include -IC:\Python35\Include -ID:\src\llvm\tools\clang\include -Itools\lldb\..\clang\include -ID:\src\llvm\tools\lldb\source\. /DWIN32 /D_WINDOWS   /https://reviews.llvm.org/W4 -wd4141 -wd4146 -wd4180 -wd4244 -wd4258 -wd4267 -wd4291 -wd4345 -wd4351 -wd4355 -wd4456 -wd4457 -wd4458 -wd4459 -wd4503 -wd4624 -wd4722 -wd4800 -wd4100 -wd4127 -wd4512 -wd4505 -wd4610 -wd4510 -wd4702 -wd4245 -wd4706 -wd4310 -wd4701 -wd4703 -wd4389 -wd4611 -wd4805 -wd4204 -wd4577 -wd4091 -wd4592 -wd4319 -wd4324 -w14062 -we4238 /Zc:inline /Zc:strictStrings /Oi /Zc:rvalueCast /Zc:sizedDealloc- /D_DEBUG /MDd /Zi /Ob0 /Od /RTC1   -wd4018 -wd4068 -wd4150 -wd4251 -wd4521 -wd4530 /D _UNICODE /D UNICODE  /EHs-c- /GR- /showIncludes /Fotools\lldb\source\Commands\CMakeFiles\lldbCommands.dir\CommandObjectMemory.cpp.obj /Fdtools\lldb\source\Commands\CMakeFiles\lldbCommands.dir\ /FS -c D:\src\llvm\tools\lldb\source\Commands\CommandObjectMemory.cpp
D:\src\llvm\tools\clang\include\clang/Basic/DiagnosticIDs.h(53): fatal error C1083: Cannot open include file: 'clang/Basic/DiagnosticCommonKinds.inc': No such file or directory
[368/2856] Building CXX object tools\lldb\source\Breakpoint\CMakeFiles\lldbBreakpoint.dir\Watchpoint.cpp.obj
FAILED: C:\PROGRA~2\MICROS~1.0\VC\bin\AMD64_~2\cl.exe   /nologo /TP -DGTEST_HAS_RTTI=0 -DLLDB_DISABLE_CURSES -DLLDB_DISABLE_LIBEDIT -DLLDB_PYTHON_HOME=\"C:/Python35\" -DUNICODE -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -D_FILE_OFFSET_BITS=64 -D_HAS_EXCEPTIONS=0 -D_LARGEFILE_SOURCE -D_SCL_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS -D_UNICODE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Itools\lldb\source\Breakpoint -ID:\src\llvm\tools\lldb\source\Breakpoint -ID:\src\llvm\tools\lldb\include -Itools\lldb\include -Iinclude -ID:\src\llvm\include -IC:\Python35\Include -ID:\src\llvm\tools\clang\include -Itools\lldb\..\clang\include -ID:\src\llvm\tools\lldb\source\. /DWIN32 /D_WINDOWS   /https://reviews.llvm.org/W4 -wd4141 -wd4146 -wd4180 -wd4244 -wd4258 -wd4267 -wd4291 -wd4345 -wd4351 -wd4355 -wd4456 -wd4457 -wd4458 -wd4459 -wd4503 -wd4624 -wd4722 -wd4800 -wd4100 -wd4127 -wd4512 -wd4505 -wd4610 -wd4510 -wd4702 -wd4245 -wd4706 -wd4310 -wd4701 -wd4703 -wd4389 -wd4611 -wd4805 -wd4204 -wd4577 -wd4091 -wd4592 -wd4319 -wd4324 -w14062 -we4238 /Zc:inline /Zc:strictStrings /Oi /Zc:rvalueCast /Zc:sizedDealloc- /D_DEBUG /MDd /Zi /Ob0 /Od /RTC1   -wd4018 -wd4068 -wd4150 -wd4251 -wd4521 -wd4530 /D _UNICODE /D UNICODE  /EHs-c- /GR- /showIncludes /Fotools\lldb\source\Breakpoint\CMakeFiles\lldbBreakpoint.dir\Watchpoint.cpp.obj /Fdtools\lldb\source\Breakpoint\CMakeFiles\lldbBreakpoint.dir\ /FS -c D:\src\llvm\tools\lldb\source\Breakpoint\Watchpoint.cpp
D:\src\llvm\tools\clang\include\clang/AST/ASTFwd.h(22): fatal error C1083: Cannot open include file: 'clang/AST/DeclNodes.inc': No such file or directory
[368/2856] Building CXX object tools\lldb\source\Commands\CMakeFiles\lldbCommands.dir\CommandObjectArgs.cpp.obj
FAILED: C:\PROGRA~2\MICROS~1.0\VC\bin\AMD64_~2\cl.exe   /nologo /TP -DGTEST_HAS_RTTI=0 -DLLDB_DISABLE_CURSES -DLLDB_DISABLE_LIBEDIT -DLLDB_PYTHON_HOME=\"C:/Python35\" -DUNICODE -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -D_FILE_OFFSET_BITS=64 -D_HAS_EXCEPTIONS=0 -D_LARGEFILE_SOURCE -D_SCL_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS -D_UNICODE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Itools\lldb\source\Commands -ID:\src\llvm\tools\lldb\source\Commands -ID:\src\llvm\tools\lldb\include -Itools\lldb\include -Iinclude -ID:\src\llvm\include -IC:\Python35\Include -ID:\src\llvm\tools\clang\include -Itools\lldb\..\clang\include -ID:\src\llvm\tools\lldb\source\. /DWIN32 /D_WINDOWS   /https://reviews.llvm.org/W4 -wd4141 -wd4146 -wd4180 -wd4244 -wd4258 -wd4267 -wd4291 -wd4345 -wd4351 -wd4355 -wd4456 -wd4457 -wd4458 -wd4459 -wd4503 -wd4624 -wd4722 -wd4800 -wd4100 -wd4127 -wd4512 -wd4505 -wd4610 -wd4510 -wd4702 -wd4245 -wd4706 -wd4310 -wd4701 -wd4703 -wd4389 -wd4611 -wd4805 -wd4204 -wd4577 -wd4091 -wd4592 -wd4319 -wd4324 -w14062 -we4238 /Zc:inline /Zc:strictStrings /Oi /Zc:rvalueCast /Zc:sizedDealloc- /D_DEBUG /MDd /Zi /Ob0 /Od /RTC1   -wd4018 -wd4068 -wd4150 -wd4251 -wd4521 -wd4530 /D _UNICODE /D UNICODE  /EHs-c- /GR- /showIncludes /Fotools\lldb\source\Commands\CMakeFiles\lldbCommands.dir\CommandObjectArgs.cpp.obj /Fdtools\lldb\source\Commands\CMakeFiles\lldbCommands.dir\ /FS -c D:\src\llvm\tools\lldb\source\Commands\CommandObjectArgs.cpp
D:\src\llvm\tools\clang\include\clang/AST/ASTFwd.h(22): fatal error C1083: Cannot open include file: 'clang/AST/DeclNodes.inc': No such file or directory
[368/2856] Building CXX object tools\lldb\source\Commands\CMakeFiles\lldbCommands.dir\CommandObjectFrame.cpp.obj
FAILED: C:\PROGRA~2\MICROS~1.0\VC\bin\AMD64_~2\cl.exe   /nologo /TP -DGTEST_HAS_RTTI=0 -DLLDB_DISABLE_CURSES -DLLDB_DISABLE_LIBEDIT -DLLDB_PYTHON_HOME=\"C:/Python35\" -DUNICODE -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -D_FILE_OFFSET_BITS=64 -D_HAS_EXCEPTIONS=0 -D_LARGEFILE_SOURCE -D_SCL_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS -D_UNICODE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Itools\lldb\source\Commands -ID:\src\llvm\tools\lldb\source\Commands -ID:\src\llvm\tools\lldb\include -Itools\lldb\include -Iinclude -ID:\src\llvm\include -IC:\Python35\Include -ID:\src\llvm\tools\clang\include -Itools\lldb\..\clang\include -ID:\src\llvm\tools\lldb\source\. /DWIN32 /D_WINDOWS   /https://reviews.llvm.org/W4 -wd4141 -wd4146 -wd4180 -wd4244 -wd4258 -wd4267 -wd4291 -wd4345 -wd4351 -wd4355 -wd4456 -wd4457 -wd4458 -wd4459 -wd4503 -wd4624 -wd4722 -wd4800 -wd4100 -wd4127 -wd4512 -wd4505 -wd4610 -wd4510 -wd4702 -wd4245 -wd4706 -wd4310 -wd4701 -wd4703 -wd4389 -wd4611 -wd4805 -wd4204 -wd4577 -wd4091 -wd4592 -wd4319 -wd4324 -w14062 -we4238 /Zc:inline /Zc:strictStrings /Oi /Zc:rvalueCast /Zc:sizedDealloc- /D_DEBUG /MDd /Zi /Ob0 /Od /RTC1   -wd4018 -wd4068 -wd4150 -wd4251 -wd4521 -wd4530 /D _UNICODE /D UNICODE  /EHs-c- /GR- /showIncludes /Fotools\lldb\source\Commands\CMakeFiles\lldbCommands.dir\CommandObjectFrame.cpp.obj /Fdtools\lldb\source\Commands\CMakeFiles\lldbCommands.dir\ /FS -c D:\src\llvm\tools\lldb\source\Commands\CommandObjectFrame.cpp
D:\src\llvm\tools\clang\include\clang/AST/ASTFwd.h(22): fatal error C1083: Cannot open include file: 'clang/AST/DeclNodes.inc': No such file or directory
[368/2856] Python script building LLDB Python wrapper
ninja: build stopped: subcommand failed.

I didn't get any errors the previous time because it wasn't a clean build.  The headers had already been generated.  So we do need to add some kind of dependency (even if it is not a link time dependency as it was with `libclang`)


https://reviews.llvm.org/D22987





More information about the llvm-commits mailing list