groovylight/sim/CMakeLists.txt
saji 2a7908eae9 wip: line scan test
also factored out some code.
2024-05-22 15:59:38 -05:00

57 lines
1.2 KiB
CMake

cmake_minimum_required(VERSION 3.20)
include(FetchContent)
project(groovylight-sim)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_C_STANDARD 11)
FetchContent_Declare(
dear_imgui
GIT_REPOSITORY https://github.com/ocornut/imgui.git
GIT_TAG 231cbee0fc4f59dbe5b8b853a11b08dc84e57c65 # version 1.90.5
)
FetchContent_Declare(
sokol
GIT_REPOSITORY https://github.com/floooh/sokol.git
GIT_TAG 55bc9cf3fa4051d485d10412c75c893c3135e885
)
FetchContent_Declare(
Catch2
GIT_REPOSITORY https://github.com/catchorg/Catch2.git
GIT_TAG v3.4.0 # or a later release
)
FetchContent_MakeAvailable(sokol dear_imgui Catch2)
list(APPEND CMAKE_MODULE_PATH ${catch2_SOURCE_DIR}/extras) # needed for the catch_discover_tests function
set(CMAKE_EXPORT_COMPILE_COMMANDS TRUE)
find_package(verilator HINTS $ENV{VERILATOR_ROOT})
add_executable(sim)
target_sources(sim PRIVATE
src/main.cpp
)
target_include_directories(sim PRIVATE inc/)
list(APPEND VSOURCES ../verilog/hub75e.sv ../verilog/lineram.v)
verilate(sim SOURCES ${VSOURCES} TRACE VERILATOR_ARGS -Wno-MULTITOP)
target_link_libraries(sim PRIVATE Catch2::Catch2WithMain)
include(CTest)
include(Catch)
catch_discover_tests(sim)