Index: CMakeLists.txt =================================================================== --- CMakeLists.txt +++ CMakeLists.txt @@ -13,15 +13,17 @@ # Rely on llvm-config. set(CONFIG_OUTPUT) - find_program(LLVM_CONFIG "llvm-config") + if(NOT LLVM_CONFIG_PATH) + find_program(LLVM_CONFIG_PATH "llvm-config") + endif() if (DEFINED LLVM_PATH) set(LLVM_INCLUDE_DIR ${LLVM_INCLUDE_DIR} CACHE PATH "Path to llvm/include") set(LLVM_PATH ${LLVM_PATH} CACHE PATH "Path to LLVM source tree") set(LLVM_MAIN_SRC_DIR ${LLVM_PATH}) set(LLVM_CMAKE_PATH "${LLVM_PATH}/cmake/modules") - elseif (LLVM_CONFIG) - message(STATUS "Found LLVM_CONFIG as ${LLVM_CONFIG}") - set(CONFIG_COMMAND ${LLVM_CONFIG} "--includedir" "--prefix" "--src-root") + elseif(LLVM_CONFIG_PATH) + message(STATUS "Found LLVM_CONFIG_PATH as ${LLVM_CONFIG_PATH}") + set(CONFIG_COMMAND ${LLVM_CONFIG_PATH} "--includedir" "--prefix" "--src-root") execute_process(COMMAND ${CONFIG_COMMAND} RESULT_VARIABLE HAD_ERROR OUTPUT_VARIABLE CONFIG_OUTPUT) Index: cmake/config-ix.cmake =================================================================== --- cmake/config-ix.cmake +++ cmake/config-ix.cmake @@ -38,6 +38,11 @@ check_cxx_compiler_flag(/EHs- LIBUNWIND_HAS_NO_EHS_FLAG) check_cxx_compiler_flag(/EHa- LIBUNWIND_HAS_NO_EHA_FLAG) check_cxx_compiler_flag(/GR- LIBUNWIND_HAS_NO_GR_FLAG) +check_cxx_compiler_flag(-std=c++11 LIBUNWIND_HAS_STD_CXX11) + +if(LIBUNWIND_HAS_STD_CXX11) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") +endif() check_library_exists(c fopen "" LIBUNWIND_HAS_C_LIB) check_library_exists(dl dladdr "" LIBUNWIND_HAS_DL_LIB)