[clang] 25a288b - [clang-repl] Fix building with win32 dylibs

Martin Storsjö via cfe-commits cfe-commits at lists.llvm.org
Sun Aug 1 13:01:55 PDT 2021


Author: Martin Storsjö
Date: 2021-08-01T23:01:00+03:00
New Revision: 25a288b009f7d30b5392ea36c29570cbdcf238c3

URL: https://github.com/llvm/llvm-project/commit/25a288b009f7d30b5392ea36c29570cbdcf238c3
DIFF: https://github.com/llvm/llvm-project/commit/25a288b009f7d30b5392ea36c29570cbdcf238c3.diff

LOG: [clang-repl] Fix building with win32 dylibs

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

Added: 
    

Modified: 
    clang/tools/clang-repl/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/clang/tools/clang-repl/CMakeLists.txt b/clang/tools/clang-repl/CMakeLists.txt
index a9dcd1f6a66bb..ae0e4f39be70f 100644
--- a/clang/tools/clang-repl/CMakeLists.txt
+++ b/clang/tools/clang-repl/CMakeLists.txt
@@ -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


        


More information about the cfe-commits mailing list