cmake_minimum_required(VERSION 3.5) project(llvm_tutorial CXX) find_package(LLVM REQUIRED CONFIG) message(STATUS "Found LLVM ${LLVM_PACKAGE_VERSION}") message(STATUS "Using LLVMConfig.cmake in: ${LLVM_DIR}") # Options to compile correctly the llvm tutorial add_compile_options(-std=c++14 -g -O0 -fno-rtti) include_directories(${LLVM_INCLUDE_DIRS}) add_definitions(${LLVM_DEFINITIONS}) add_executable(kaleidoscope Chapter3.cpp) # Find the libraries that correspond to the LLVM components # that we wish to use llvm_map_components_to_libnames(llvm_libs core support native mcjit) # Link against LLVM libraries target_link_libraries(kaleidoscope ${llvm_libs})