[PATCH] D119049: [LLD] Allow usage of LLD as a library

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 24 14:30:29 PST 2023


arsenm added inline comments.


================
Comment at: lld/CMakeLists.txt:207-212
+  add_custom_target(LLDUnitTests)
+  if (EXISTS ${LLVM_THIRD_PARTY_DIR}/unittest/googletest/include/gtest/gtest.h)
+    add_subdirectory(unittests)
+  else()
+    message(WARNING "gtest not found, unittests will not be available")
+  endif()
----------------
Feels like this isn't something lld should have to roll its own handling for


================
Comment at: lld/Common/DriversMain.cpp:162-172
+  auto link = [&]() {
+    if (f == MinGW)
+      return mingw::link;
+    else if (f == Gnu)
+      return elf::link;
+    else if (f == WinLink)
+      return coff::link;
----------------
Should move to a separate function with a switch/return


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D119049/new/

https://reviews.llvm.org/D119049



More information about the llvm-commits mailing list