From bd1a192fafbf64ffbe602bfc1cb043f9267b9ae5 Mon Sep 17 00:00:00 2001 From: Ryan Houdek Date: Sun, 26 Oct 2014 16:17:57 -0500 Subject: [PATCH] Fixes LLVM library detection. I must have had a dirty cmake configuration which didn't encounter this issue. Make sure we are using LLVM_DEFINITIONS to know where we are linking to libraries at. Link against libLLVM-${VERSION}, the other one was linking us against static libraries... --- CMakeLists.txt | 1 + CMakeTests/FindLLVM.cmake | 11 ++++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index baad81aca4..b672f9fe30 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -411,6 +411,7 @@ if(NOT ANDROID) set(HAS_LLVM 1) include_directories(${LLVM_INCLUDE_DIRS}) + add_definitions(${LLVM_DEFINITIONS}) message(STATUS "Found LLVM ${LLVM_PACKAGE_VERSION}") endif() diff --git a/CMakeTests/FindLLVM.cmake b/CMakeTests/FindLLVM.cmake index ab7c50cbe6..881156b10d 100644 --- a/CMakeTests/FindLLVM.cmake +++ b/CMakeTests/FindLLVM.cmake @@ -9,14 +9,15 @@ foreach(LLVM_CONFIG_NAME ${LLVM_CONFIG_EXECUTABLES}) find_program(LLVM_CONFIG_EXE NAMES ${LLVM_CONFIG_NAME}) if (LLVM_CONFIG_EXE) set(LLVM_FOUND 1) - execute_process(COMMAND ${LLVM_CONFIG_EXE} --includedir --prefix OUTPUT_VARIABLE LLVM_INCLUDE_DIRS + execute_process(COMMAND ${LLVM_CONFIG_EXE} --includedir OUTPUT_VARIABLE LLVM_INCLUDE_DIRS OUTPUT_STRIP_TRAILING_WHITESPACE ) - execute_process(COMMAND ${LLVM_CONFIG_EXE} --ldflags --prefix OUTPUT_VARIABLE LLVM_DEFINITIONS + execute_process(COMMAND ${LLVM_CONFIG_EXE} --ldflags OUTPUT_VARIABLE LLVM_DEFINITIONS OUTPUT_STRIP_TRAILING_WHITESPACE ) - execute_process(COMMAND ${LLVM_CONFIG_EXE} --libs Core --prefix OUTPUT_VARIABLE LLVM_LIBRARIES - OUTPUT_STRIP_TRAILING_WHITESPACE ) - execute_process(COMMAND ${LLVM_CONFIG_EXE} --version --prefix OUTPUT_VARIABLE LLVM_PACKAGE_VERSION + #execute_process(COMMAND ${LLVM_CONFIG_EXE} --libfiles Core OUTPUT_VARIABLE LLVM_LIBRARIES + # OUTPUT_STRIP_TRAILING_WHITESPACE ) + execute_process(COMMAND ${LLVM_CONFIG_EXE} --version OUTPUT_VARIABLE LLVM_PACKAGE_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE ) + set(LLVM_LIBRARIES "-lLLVM-${LLVM_PACKAGE_VERSION}") break() endif() endforeach()