From 62b23f5da5a29f54499f5339bc0f98c06e27af8f Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Mon, 19 Jun 2017 10:33:19 -0400 Subject: [PATCH] build: link against system libs reported by llvm-config --- .gitignore | 1 + cmake/Findllvm.cmake | 10 +++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 97c6d25d16..361488f316 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ build/ build-release/ build-windows/ build-llvm-5/ +build-llvm-debug/ /.cproject /.project /.settings/ diff --git a/cmake/Findllvm.cmake b/cmake/Findllvm.cmake index 8459efe19c..29dd0fda1a 100644 --- a/cmake/Findllvm.cmake +++ b/cmake/Findllvm.cmake @@ -20,6 +20,11 @@ execute_process( OUTPUT_VARIABLE LLVM_LIBRARIES OUTPUT_STRIP_TRAILING_WHITESPACE) +execute_process( + COMMAND ${LLVM_CONFIG_EXE} --system-libs + OUTPUT_VARIABLE LLVM_SYSTEM_LIBS + OUTPUT_STRIP_TRAILING_WHITESPACE) + execute_process( COMMAND ${LLVM_CONFIG_EXE} --libdir OUTPUT_VARIABLE LLVM_LIBDIRS @@ -32,14 +37,13 @@ execute_process( find_library(LLVM_LIBRARY NAMES LLVM) +set(LLVM_LIBRARIES ${LLVM_LIBRARIES} ${LLVM_SYSTEM_LIBS}) + if(LLVM_LIBRARY) set(LLVM_LIBRARIES ${LLVM_LIBRARY}) endif() -set(LLVM_LIBRARIES ${LLVM_LIBRARIES} ${LLVM_SYSTEM_LIBS}) - - include(FindPackageHandleStandardArgs) find_package_handle_standard_args(LLVM DEFAULT_MSG LLVM_LIBRARIES LLVM_INCLUDE_DIR)