[Lldb-commits] [PATCH] D60180: [CMake] Don't explicitly use LLVM_LIBRARY_DIR in standalone builds

Stefan Gränitz via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Apr 3 06:25:41 PDT 2019


sgraenitz added a comment.

Major concern from my side is that clang does something like this too:

  clang/CMakeLists.txt
  86:  set(LLVM_LIBRARY_DIR ${LIBRARY_DIR} CACHE PATH "Path to llvm/lib")
  125:  link_directories("${LLVM_LIBRARY_DIR}")

It looks like AddLLVM.cmake uses it in function `configure_lit_site_cfg`:

  # They below might not be the build tree but provided binary tree.
  set(LLVM_SOURCE_DIR ${LLVM_MAIN_SRC_DIR})
  set(LLVM_BINARY_DIR ${LLVM_BINARY_DIR})
  string(REPLACE "${CMAKE_CFG_INTDIR}" "${LLVM_BUILD_MODE}" LLVM_TOOLS_DIR "${LLVM_TOOLS_BINARY_DIR}")
  string(REPLACE ${CMAKE_CFG_INTDIR} ${LLVM_BUILD_MODE} LLVM_LIBS_DIR  "${LLVM_LIBRARY_DIR}")

So we should always have some value for `LLVM_LIBRARY_DIR`. Not sure about the `link_directories` line.
Did you build and run test suite with this change? How does this string Replace work then?

> This is an issue because if you built libc++, it will try to link against that one instead of the one from the android NDK.

Looking in-tree first seems like a reasonable default. You are cross-compiling only lldb-server so it can run on Android right? Everything else is built for your host platform?


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

https://reviews.llvm.org/D60180





More information about the lldb-commits mailing list