Skip to content

Commit

Permalink
Tweak Jan Kratochvil's "Simplify linked libraries: LLVMSupport -> LLVM"
Browse files Browse the repository at this point in the history
change.

Don't hardcode LLVM (or LLVMSupport), but use: `llvm-config --libs`
  • Loading branch information
Peeter Joot committed Sep 22, 2019
1 parent c174c0c commit 2d1a12e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,4 @@ add_executable(lldb-mi
MIUtilVariant.cpp
)

target_link_libraries(lldb-mi lldb LLVM pthread)
target_link_libraries(lldb-mi lldb `llvm-config --libs` pthread)

2 comments on commit 2d1a12e

@tedwoodward
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a bit simpler than that. Change LLVM to LLVMSupport and it works.

@peeterjoot
Copy link
Owner

@peeterjoot peeterjoot commented on 2d1a12e Oct 1, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tedwoodward

LLVMSupport

The original patch made by Jan, seems to indicate that LLVMSupport isn't available in all build configurations:

"
commit 2484a37
Author: Jan Kratochvil jan.kratochvil@redhat.com
Date: Wed Jul 24 12:01:41 2019 +0200

Simplify linked libraries: LLVMSupport -> LLVM

Fedora 30 has libLLVMSupport only in 'llvm-static' which does not need to be
installed:
        [100%] Linking CXX executable lldb-mi
        /usr/bin/ld: cannot find -lLLVMSupport
        collect2: error: ld returned 1 exit status

Also I had some compatibility problem linking both static and dynamic libraries:
        : CommandLine Error: Option 'disable-symbolication' registered more than once!
        LLVM ERROR: inconsistency in registered CommandLine options

"

His change was almost exactly opposite of what you are suggesting:

git diff 33cb214..2484a37 -- src/CMakeLists.txt
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 57466df..8ddc65a 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -74,4 +74,4 @@ add_executable(lldb-mi
MIUtilVariant.cpp
)

-target_link_libraries(lldb-mi lldb LLVMSupport)
+target_link_libraries(lldb-mi lldb LLVM pthread)

Please sign in to comment.