From 3eb3755949278fe10a89b92a6c4612d536f1f295 Mon Sep 17 00:00:00 2001 From: NAKAMURA Takumi Date: Fri, 27 Jul 2012 06:17:56 +0000 Subject: [PATCH] libclang, examples: [CMake] Add dependencies to tblgen'd headers. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160849 91177308-0d34-0410-b5e6-96231b3b80d8 --- examples/PrintFunctionNames/CMakeLists.txt | 9 +++++++++ examples/analyzer-plugin/CMakeLists.txt | 9 +++++++++ tools/libclang/CMakeLists.txt | 13 +++++++++++++ 3 files changed, 31 insertions(+) diff --git a/examples/PrintFunctionNames/CMakeLists.txt b/examples/PrintFunctionNames/CMakeLists.txt index a31a8f69e7..ba6a350cd9 100644 --- a/examples/PrintFunctionNames/CMakeLists.txt +++ b/examples/PrintFunctionNames/CMakeLists.txt @@ -4,6 +4,15 @@ set( LLVM_LINK_COMPONENTS support mc) add_clang_library(PrintFunctionNames PrintFunctionNames.cpp) +add_dependencies(PrintFunctionNames + ClangAttrClasses + ClangAttrList + ClangCommentNodes + ClangDeclNodes + ClangDiagnosticCommon + ClangStmtNodes + ) + target_link_libraries(PrintFunctionNames clangFrontend clangAST diff --git a/examples/analyzer-plugin/CMakeLists.txt b/examples/analyzer-plugin/CMakeLists.txt index 9ad5cace80..ba73030cc3 100644 --- a/examples/analyzer-plugin/CMakeLists.txt +++ b/examples/analyzer-plugin/CMakeLists.txt @@ -4,6 +4,15 @@ set( LLVM_LINK_COMPONENTS support mc) add_clang_library(SampleAnalyzerPlugin MainCallChecker.cpp) +add_dependencies(SampleAnalyzerPlugin + ClangAttrClasses + ClangAttrList + ClangCommentNodes + ClangDeclNodes + ClangDiagnosticCommon + ClangStmtNodes + ) + target_link_libraries(SampleAnalyzerPlugin clangStaticAnalyzerCore ) diff --git a/tools/libclang/CMakeLists.txt b/tools/libclang/CMakeLists.txt index 627003832f..45f5e13fc8 100644 --- a/tools/libclang/CMakeLists.txt +++ b/tools/libclang/CMakeLists.txt @@ -53,10 +53,22 @@ set(LIBRARIES clangBasic ) +set(GENERATED_HEADERS + ClangAttrClasses + ClangAttrList + ClangAttrParsedAttrList + ClangCommentNodes + ClangDiagnosticCommon + ClangDiagnosticFrontend + ClangDeclNodes + ClangStmtNodes + ) + if( LLVM_ENABLE_PIC ) set(SHARED_LIBRARY TRUE) add_clang_library(libclang ${SOURCES}) target_link_libraries(libclang ${LIBRARIES}) + add_dependencies(libclang ${GENERATED_HEADERS}) if(WIN32) set_target_properties(libclang @@ -90,6 +102,7 @@ endif() if( NOT BUILD_SHARED_LIBS AND NOT WIN32 ) add_clang_library(${LIBCLANG_STATIC_TARGET_NAME} STATIC ${SOURCES}) target_link_libraries(${LIBCLANG_STATIC_TARGET_NAME} ${LIBRARIES}) + add_dependencies(${LIBCLANG_STATIC_TARGET_NAME} ${GENERATED_HEADERS}) set_target_properties(${LIBCLANG_STATIC_TARGET_NAME} PROPERTIES