RVSCC/fw/CMakeLists.txt

14 lines
475 B
CMake
Raw Normal View History

cmake_minimum_required(VERSION 3.10)
project(rv32fw C)
set(CMAKE_C_FLAGS "-Os -g -Wall -ffunction-sections")
2022-11-28 07:54:18 +00:00
#set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -nostartfiles -fno-exceptions -Xlinker")
add_executable(${PROJECT_NAME} src/main.c)
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
2022-11-28 07:54:18 +00:00
COMMAND ${CMAKE_OBJCOPY} -j .text -O verilog --verilog-data-width=4 "$<TARGET_FILE:${PROJECT_NAME}>" rv32fw.hex
COMMENT "Invoking: Verilog Hexdump"
VERBATIM)