From 8db5174395a3b145c14c8bb5bf01382281a6a10c Mon Sep 17 00:00:00 2001 From: Etienne Bergeron Date: Fri, 13 May 2016 17:38:22 +0000 Subject: [PATCH] [include-fixer] Fix broken dependency shared build Summary: The shared build is broken (again). To repro: [Release + Shared] ``` -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON ``` Errors: ``` tools/clang/tools/extra/include-fixer/tool/CMakeFiles/clang-include-fixer.dir/ClangIncludeFixer.cpp.o: In function `(anonymous namespace)::includeFixerMain(int, char const**)': ClangIncludeFixer.cpp:(.text._ZN12_GLOBAL__N_116includeFixerMainEiPPKc+0xbe9): undefined reference to `clang::find_all_symbols::SymbolInfo::SymbolInfo(llvm::StringRef, clang::find_all_symbols::SymbolInfo::SymbolKind, llvm::StringRef, int, std::vector, std::allocator > > const&)' collect2: error: ld returned 1 exit status ``` ``` tools/clang/tools/extra/unittests/include-fixer/CMakeFiles/IncludeFixerTests.dir/IncludeFixerTest.cpp.o: In function `clang::include_fixer::(anonymous namespace)::runIncludeFixer(llvm::StringRef, std::vector > const&)': IncludeFixerTest.cpp:(.text._ZN5clang13include_fixer12_GLOBAL__N_1L15runIncludeFixerEN4llvm9StringRefERKSt6vectorISsSaISsEE+0x10e): undefined reference to `clang::find_all_symbols::SymbolInfo::SymbolInfo(llvm::StringRef, clang::find_all_symbols::SymbolInfo::SymbolKind, llvm::StringRef, int, std::vector, std::allocator > > const&)' IncludeFixerTest.cpp:(.text._ZN5clang13include_fixer12_GLOBAL__N_1L15runIncludeFixerEN4llvm9StringRefERKSt6vectorISsSaISsEE+0x1dc): undefined reference to `clang::find_all_symbols::SymbolInfo::SymbolInfo(llvm::StringRef, clang::find_all_symbols::SymbolInfo::SymbolKind, llvm::StringRef, int, std::vector, std::allocator > > const&)' IncludeFixerTest.cpp:(.text._ZN5clang13include_fixer12_GLOBAL__N_1L15runIncludeFixerEN4llvm9StringRefERKSt6vectorISsSaISsEE+0x2f3): undefined reference to `clang::find_all_symbols::SymbolInfo::SymbolInfo(llvm::StringRef, clang::find_all_symbols::SymbolInfo::SymbolKind, llvm::StringRef, int, std::vector, std::allocator > > const&)' IncludeFixerTest.cpp:(.text._ZN5clang13include_fixer12_GLOBAL__N_1L15runIncludeFixerEN4llvm9StringRefERKSt6vectorISsSaISsEE+0x40e): undefined reference to `clang::find_all_symbols::SymbolInfo::SymbolInfo(llvm::StringRef, clang::find_all_symbols::SymbolInfo::SymbolKind, llvm::StringRef, int, std::vector, std::allocator > > const&)' IncludeFixerTest.cpp:(.text._ZN5clang13include_fixer12_GLOBAL__N_1L15runIncludeFixerEN4llvm9StringRefERKSt6vectorISsSaISsEE+0x526): undefined reference to `clang::find_all_symbols::SymbolInfo::SymbolInfo(llvm::StringRef, clang::find_all_symbols::SymbolInfo::SymbolKind, llvm::StringRef, int, std::vector, std::allocator > > const&)' ``` Reviewers: bkramer, hokein Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D20245 llvm-svn: 269441 --- clang-tools-extra/include-fixer/find-all-symbols/SymbolInfo.h | 2 +- clang-tools-extra/include-fixer/tool/CMakeLists.txt | 1 + clang-tools-extra/unittests/include-fixer/CMakeLists.txt | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/clang-tools-extra/include-fixer/find-all-symbols/SymbolInfo.h b/clang-tools-extra/include-fixer/find-all-symbols/SymbolInfo.h index f0fae99406ff..c5ee94045fba 100644 --- a/clang-tools-extra/include-fixer/find-all-symbols/SymbolInfo.h +++ b/clang-tools-extra/include-fixer/find-all-symbols/SymbolInfo.h @@ -47,7 +47,7 @@ public: // The default constructor is required by YAML traits in // LLVM_YAML_IS_DOCUMENT_LIST_VECTOR. - SymbolInfo() : Type(SymbolKind::Unknown), LineNumber(-1) {}; + SymbolInfo() : Type(SymbolKind::Unknown), LineNumber(-1) {} SymbolInfo(llvm::StringRef Name, SymbolKind Type, llvm::StringRef FilePath, int LineNumber, const std::vector &Contexts); diff --git a/clang-tools-extra/include-fixer/tool/CMakeLists.txt b/clang-tools-extra/include-fixer/tool/CMakeLists.txt index e34bf11ccc1a..4ce5d5090eec 100644 --- a/clang-tools-extra/include-fixer/tool/CMakeLists.txt +++ b/clang-tools-extra/include-fixer/tool/CMakeLists.txt @@ -8,4 +8,5 @@ target_link_libraries(clang-include-fixer clangRewrite clangTooling clangToolingCore + findAllSymbols ) diff --git a/clang-tools-extra/unittests/include-fixer/CMakeLists.txt b/clang-tools-extra/unittests/include-fixer/CMakeLists.txt index 0d1124f39842..d285cd67beea 100644 --- a/clang-tools-extra/unittests/include-fixer/CMakeLists.txt +++ b/clang-tools-extra/unittests/include-fixer/CMakeLists.txt @@ -22,6 +22,7 @@ target_link_libraries(IncludeFixerTests clangRewrite clangTooling clangToolingCore + findAllSymbols ) add_subdirectory(find-all-symbols)