From: Christoph Egger Date: Tue, 27 May 2014 13:19:53 +0000 (+0200) Subject: Fail if llvm can not be found X-Git-Tag: v0.1~194 X-Git-Url: https://git.siccegge.de//index.cgi?p=frida%2Ffrida.git;a=commitdiff_plain;h=ce2200d137c1877102e87e816e1aad04bf12034b Fail if llvm can not be found --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 0cef065..0eab70c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,9 +14,15 @@ pkg_check_modules(LOG4CXX REQUIRED liblog4cxx) #add_compile_options(${LOG4CXX_CFLAGS}) add_definitions(${LOG4CXX_CFLAGS}) -execute_process(COMMAND llvm-config-3.5 --cxxflags OUTPUT_VARIABLE LLVM_CFLAGS OUTPUT_STRIP_TRAILING_WHITESPACE) -execute_process(COMMAND llvm-config-3.5 --ldflags OUTPUT_VARIABLE LLVM_LDFLAGS OUTPUT_STRIP_TRAILING_WHITESPACE) -execute_process(COMMAND llvm-config-3.5 --libs OUTPUT_VARIABLE LLVM_LIBS OUTPUT_STRIP_TRAILING_WHITESPACE) +find_program(LLVM_CONFIG llvm-config-3.5) + +if(NOT LLVM_CONFIG) + message(FATAL_ERROR "LLVM not found") +endif() + +execute_process(COMMAND ${LLVM_CONFIG} --cxxflags OUTPUT_VARIABLE LLVM_CFLAGS OUTPUT_STRIP_TRAILING_WHITESPACE) +execute_process(COMMAND ${LLVM_CONFIG} --ldflags OUTPUT_VARIABLE LLVM_LDFLAGS OUTPUT_STRIP_TRAILING_WHITESPACE) +execute_process(COMMAND ${LLVM_CONFIG} --libs OUTPUT_VARIABLE LLVM_LIBS OUTPUT_STRIP_TRAILING_WHITESPACE) separate_arguments(LLVM_CFLAGS) add_definitions(${LLVM_CFLAGS})