diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt index 3330855c..e9c060f9 100644 --- a/core/CMakeLists.txt +++ b/core/CMakeLists.txt @@ -75,12 +75,18 @@ if(NOT LLDB_PATH) set(LLDB_PATH ${LLVM_PATH}) else() set(LLVM_VERSION 16.0.0 CACHE STRING "Version of LLVM to use") + if(ASAN) + # Require asan clang to prevent spurious use-after-poison reports + set(LLVM_VERSION_DIR "${LLVM_VERSION}-asan") + else() + set(LLVM_VERSION_DIR "${LLVM_VERSION}") + endif() if(DEFINED ENV{LLVM_INSTALL_DIR}) - set(LLDB_PATH $ENV{LLVM_INSTALL_DIR}/${LLVM_VERSION}) + set(LLDB_PATH $ENV{LLVM_INSTALL_DIR}/${LLVM_VERSION_DIR}) elseif(WIN32) - set(LLDB_PATH $ENV{HOMEDRIVE}$ENV{HOMEPATH}/libclang/${LLVM_VERSION}) + set(LLDB_PATH $ENV{HOMEDRIVE}$ENV{HOMEPATH}/libclang/${LLVM_VERSION_DIR}) else() - set(LLDB_PATH $ENV{HOME}/libclang/${LLVM_VERSION}) + set(LLDB_PATH $ENV{HOME}/libclang/${LLVM_VERSION_DIR}) endif() endif() endif()