From a054b253d8c516ac170cd5fc7b0c73c5a0d96824 Mon Sep 17 00:00:00 2001 From: Frederich Munch Date: Sun, 5 Jun 2016 19:04:38 -0400 Subject: [PATCH] Fix CMake projects to link to proper libraries when built as shared library. --- lib/Interpreter/CMakeLists.txt | 15 ++++++++++++++- lib/MetaProcessor/CMakeLists.txt | 6 ++++-- lib/UserInterface/CMakeLists.txt | 5 +++++ lib/Utils/CMakeLists.txt | 5 ++++- tools/driver/CMakeLists.txt | 10 +--------- 5 files changed, 28 insertions(+), 13 deletions(-) diff --git a/lib/Interpreter/CMakeLists.txt b/lib/Interpreter/CMakeLists.txt index 5e260bc8..a1a42a78 100644 --- a/lib/Interpreter/CMakeLists.txt +++ b/lib/Interpreter/CMakeLists.txt @@ -54,13 +54,26 @@ add_cling_library(clingInterpreter OBJECT ValuePrinterSynthesizer.cpp LINK_LIBS + LLVMSupport + LLVMMC + LLVMObject + LLVMAnalysis + LLVMExecutionEngine + LLVMCodeGen + LLVMRuntimeDyld + LLVMTarget # for Target::Target() + LLVMCore clangBasic + clangSerialization clangAST - clangParse clangCodeGen clangFrontend clangDriver + clangParse + clangLex + clangSema clingUtils + dl ) add_library(clingInterpreter-interface INTERFACE) diff --git a/lib/MetaProcessor/CMakeLists.txt b/lib/MetaProcessor/CMakeLists.txt index 2ef9274a..05e97980 100644 --- a/lib/MetaProcessor/CMakeLists.txt +++ b/lib/MetaProcessor/CMakeLists.txt @@ -19,13 +19,15 @@ add_cling_library(clingMetaProcessor OBJECT MetaSema.cpp LINK_LIBS + LLVMCore + LLVMSupport clangBasic + clangAST clangLex clingInterpreter - LLVMCore ) -add_dependencies(clingMetaProcessor clangBasic LLVMCore) +add_dependencies(clingMetaProcessor clangBasic LLVMSupport) if ( MSVC ) set_target_properties(clingMetaProcessor PROPERTIES diff --git a/lib/UserInterface/CMakeLists.txt b/lib/UserInterface/CMakeLists.txt index 0b3ba91f..3e96256b 100644 --- a/lib/UserInterface/CMakeLists.txt +++ b/lib/UserInterface/CMakeLists.txt @@ -30,6 +30,11 @@ add_cling_library(clingUserInterface ${TEXTINPUTSRC}textinput/TerminalDisplayWin.cpp ${TEXTINPUTSRC}textinput/TextInput.cpp ${TEXTINPUTSRC}textinput/TextInputContext.cpp + + LINK_LIBS + LLVMSupport + clingMetaProcessor + clingInterpreter ) add_dependencies(clingUserInterface clangBasic) diff --git a/lib/Utils/CMakeLists.txt b/lib/Utils/CMakeLists.txt index a6240cfd..a6ba6c1b 100644 --- a/lib/Utils/CMakeLists.txt +++ b/lib/Utils/CMakeLists.txt @@ -11,11 +11,14 @@ add_cling_library(clingUtils OBJECT Validation.cpp LINK_LIBS + LLVMSupport clangCodeGen clangBasic + clangAST + clangSema ) -add_dependencies(clingUtils clangBasic clangCodeGen) +add_dependencies(clingUtils LLVMSupport clangBasic clangCodeGen) if ( MSVC ) set_target_properties(clingUtils PROPERTIES diff --git a/tools/driver/CMakeLists.txt b/tools/driver/CMakeLists.txt index f5c86e68..7ebb164b 100644 --- a/tools/driver/CMakeLists.txt +++ b/tools/driver/CMakeLists.txt @@ -16,15 +16,7 @@ set_target_properties(cling PROPERTIES ENABLE_EXPORTS 1) target_link_libraries(cling - clangAST - clangBasic - clangCodeGen - clangDriver - clangFrontend - clangLex - clangParse - clangSema - clangSerialization + LLVMSupport clingUserInterface clingMetaProcessor