title: Linker is unable to find LLVM libraries on Windows using CLion and CMake
body: <p>I'm using latest version of CLion and MSYS Clang toolchain based on this <a href="https://blog.jetbrains.com/clion/2020/12/setting-up-clang-on-windows/" rel="nofollow noreferrer">this tutorial</a>.<br />
  I've built LLVM myself using <a href="https://llvm.org/docs/GettingStartedVS.html" rel="nofollow noreferrer">this</a>.</p>
  <p>My CMakeList.txt:</p>
  <pre><code>project(SimpleProject)
  
  set(LLVM_DIR D://LLVM/build/lib/cmake/llvm)
  find_package(LLVM REQUIRED CONFIG)
  
  message(STATUS &quot;Found LLVM ${LLVM_PACKAGE_VERSION}&quot;)
  message(STATUS &quot;Using LLVMConfig.cmake in: ${LLVM_DIR}&quot;)
  
  # Set your project compile flags.
  # E.g. if using the C++ header files
  # you will need to enable C++11 support
  # for your compiler.
  
  include_directories(${LLVM_INCLUDE_DIRS})
  separate_arguments(LLVM_DEFINITIONS_LIST NATIVE_COMMAND ${LLVM_DEFINITIONS})
  add_definitions(${LLVM_DEFINITIONS_LIST})
  
  # Now build our tools
  add_executable(simple-tool main.cpp)
  
  # Find the libraries that correspond to the LLVM components
  # that we wish to use
  llvm_map_components_to_libnames(llvm_libs support core irreader)
  
  # Link against LLVM libraries
  target_link_libraries(simple-tool ${llvm_libs})
  </code></pre>
  <p>I'm trying to run LLVM Fibonacci example, but get errors as such:</p>
  <pre><code>ld.lld: error: undefined symbol: llvm::User::operator new(unsigned long long)
  &gt;&gt;&gt; referenced by CMakeFiles/simple-tool.dir/main.cpp.obj:(main)
  
  ld.lld: error: undefined symbol: llvm::Function::Function(llvm::FunctionType*, llvm::GlobalValue::LinkageTypes, unsigned int, llvm::Twine const&amp;, llvm::Module*)
  &gt;&gt;&gt; referenced by CMakeFiles/simple-tool.dir/main.cpp.obj:(main)
  </code></pre>
  <p><a href="https://pastebin.com/JV1WPBaR" rel="nofollow noreferrer">Full log</a></p>
  <p>Content of <code>${llvm_libs}</code>:</p>
  <pre><code>LLVMSupport;LLVMCore;LLVMIRReader
  </code></pre>
  <p>I can open this &quot;symbols&quot; through CLion, but for some reason linker is unable to find them.</p>