CMakeLists.txt 666 B

1234567891011121314151617181920212223
  1. cmake_minimum_required(VERSION 3.5)
  2. project(llvm_tutorial CXX)
  3. find_package(LLVM REQUIRED CONFIG)
  4. message(STATUS "Found LLVM ${LLVM_PACKAGE_VERSION}")
  5. message(STATUS "Using LLVMConfig.cmake in: ${LLVM_DIR}")
  6. # Options to compile correctly the llvm tutorial
  7. add_compile_options(-std=c++14 -g -O3)
  8. include_directories(${LLVM_INCLUDE_DIRS})
  9. add_definitions(${LLVM_DEFINITIONS})
  10. add_executable(kaleidoscope LexerParser.cpp Ast.cpp)
  11. # Find the libraries that correspond to the LLVM components
  12. # that we wish to use
  13. llvm_map_components_to_libnames(llvm_libs core support native mcjit)
  14. # Link against LLVM libraries
  15. target_link_libraries(kaleidoscope ${llvm_libs})