Index: lldb/trunk/CMakeLists.txt =================================================================== --- lldb/trunk/CMakeLists.txt +++ lldb/trunk/CMakeLists.txt @@ -40,6 +40,15 @@ add_subdirectory(scripts) endif () +# We need the headers generated by instrinsics_gen before we can compile +# any source file in LLDB as the imported Clang modules might include +# some of these generated headers. This approach is copied from Clang's main +# CMakeLists.txt, so it should kept in sync the code in Clang which was added +# in llvm-svn 308844. +if(LLVM_ENABLE_MODULES AND NOT LLDB_BUILT_STANDALONE) + list(APPEND LLVM_COMMON_DEPENDS intrinsics_gen) +endif() + if(CMAKE_CROSSCOMPILING AND LLDB_BUILT_STANDALONE) set(LLVM_USE_HOST_TOOLS ON) include(CrossCompile)