finish writing interpreter, ready to debug

This commit is contained in:
2024-07-25 03:48:16 +00:00
parent 69adad54ad
commit 1a31786850
4 changed files with 919 additions and 1 deletions

View File

@ -14,3 +14,18 @@ add_executable(alu demo/alu.cpp)
# For debug build
add_executable(modules demo/modules.cpp)
target_compile_definitions(modules PRIVATE _DEBUG)
add_executable(code src/rv32iinterpreter.cpp)
set_target_properties(code
PROPERTIES
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}"
)
# Enable sanitizer for debug builds
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
set(SANITIZER_FLAGS "-fsanitize=address,undefined -fno-omit-frame-pointer")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${SANITIZER_FLAGS}")
set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} ${SANITIZER_FLAGS}")
endif()
endif()