Skip to content

Commit

Permalink
[clang-repl] Fix building with win32 dylibs
Browse files Browse the repository at this point in the history
Use `clang_target_link_libraries` to avoid duplicate libraries when
the same symbol is provided both by a static library and a larger
dylib, fixing linking with win32 dylibs. This fixes errors like
these:

    ld.lld: error: duplicate symbol: llvm::createStringError(std::__1::error_code, char const*)
    >>> defined at libLLVMSupport.a(Error.cpp.obj)
    >>> defined at libLLVM-14git.dll

This matches how other clang tools declare their dependencies.

Differential Revision: https://reviews.llvm.org/D107231

(cherry picked from commit 25a288b)
  • Loading branch information
mstorsjo committed Aug 2, 2021
1 parent 568767b commit 332ac2f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion clang/tools/clang-repl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ add_clang_executable(clang-repl
ClangRepl.cpp
)

target_link_libraries(clang-repl PUBLIC
clang_target_link_libraries(clang-repl PUBLIC
clangBasic
clangInterpreter
clangTooling
Expand Down

0 comments on commit 332ac2f

Please sign in to comment.