From cf3ba671bfb265c2d5744205fc0dbb24cc0001f0 Mon Sep 17 00:00:00 2001 From: Gabriel Corona Date: Tue, 28 Oct 2014 01:02:56 +0100 Subject: [PATCH] Fix LLVM $(llvm-config --ldflags) was passed to the compiler but it needs to be passed to the linker instead (-L and -l flags). --- CMakeLists.txt | 1 - CMakeTests/FindLLVM.cmake | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b672f9fe30..baad81aca4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -411,7 +411,6 @@ 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 881156b10d..89975abbe5 100644 --- a/CMakeTests/FindLLVM.cmake +++ b/CMakeTests/FindLLVM.cmake @@ -11,13 +11,13 @@ foreach(LLVM_CONFIG_NAME ${LLVM_CONFIG_EXECUTABLES}) set(LLVM_FOUND 1) execute_process(COMMAND ${LLVM_CONFIG_EXE} --includedir OUTPUT_VARIABLE LLVM_INCLUDE_DIRS OUTPUT_STRIP_TRAILING_WHITESPACE ) - execute_process(COMMAND ${LLVM_CONFIG_EXE} --ldflags OUTPUT_VARIABLE LLVM_DEFINITIONS + execute_process(COMMAND ${LLVM_CONFIG_EXE} --ldflags OUTPUT_VARIABLE LLVM_LDFLAGS OUTPUT_STRIP_TRAILING_WHITESPACE ) #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}") + set(LLVM_LIBRARIES "${LLVM_LDFLAGS} -lLLVM-${LLVM_PACKAGE_VERSION}") break() endif() endforeach()