cmake_minimum_required(VERSION 3.15) project(MyLLVMProject) # Set C++ standard set(CMAKE_CXX_STANDARD 26) set(CMAKE_CXX_STANDARD_REQUIRED YES) # # Find LLVM # find_package(LLVM REQUIRED CONFIG) # # # Include LLVM directories # message(STATUS "Found LLVM ${LLVM_PACKAGE_VERSION}") # message(STATUS "Using LLVMConfig.cmake in: ${LLVM_DIR}") # include_directories(${LLVM_INCLUDE_DIRS}) # add_definitions(${LLVM_DEFINITIONS}) # # # Optionally list LLVM components # set(LLVM_COMPONENTS # core # support # irreader # # add more components as needed # ) # # # Generate LLVM link flags # llvm_map_components_to_libnames(LLVM_LIBS ${LLVM_COMPONENTS}) # Add your source file and compile to object # add_library(MyObjectFile OBJECT main.cpp) # Replace main.cpp with your source # Add executable or another target that links to the object and LLVM add_executable(bb src/main.cpp) # target_link_libraries(MyExecutable ${LLVM_LIBS})