cmake_minimum_required(VERSION 3.14)
project(cfgrip)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

include(FetchContent)
FetchContent_Declare(
    capstone
    GIT_REPOSITORY https://github.com/capstone-engine/capstone.git
    GIT_TAG 5.0.7
)
set(CAPSTONE_BUILD_TESTS OFF)
set(CAPSTONE_BUILD_SHARED OFF)
set(CAPSTONE_BUILD_CSTOOL OFF)
set(CAPSTONE_BUILD_CSVIEW OFF)
FetchContent_MakeAvailable(capstone)

add_executable(cfgrip
    main.cpp
    loader/binary.cpp
    loader/pe.cpp
    loader/elf.cpp
    disasm/engine.cpp
    cfg/builder.cpp
)

target_include_directories(cfgrip PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
target_include_directories(cfgrip PRIVATE ${capstone_SOURCE_DIR}/include)

target_link_libraries(cfgrip capstone_static)
