2025-01-16 11:09:58 +01:00
|
|
|
cmake_minimum_required(VERSION 3.21)
|
2024-12-17 12:34:07 +01:00
|
|
|
project(dhrystone C)
|
2025-01-16 11:09:58 +01:00
|
|
|
set(TARGET dhrystone)
|
|
|
|
set(CMAKE_BUILD_TYPE Release)
|
|
|
|
set(ITERATIONS 50000) # 20000 for TGC
|
|
|
|
|
|
|
|
add_executable(${TARGET} dhry_1.c dhry_2.c dhry_stubs.c)
|
|
|
|
target_include_directories(${TARGET} PRIVATE ${CMAKE_CURRENT_LIST_DIR})
|
|
|
|
target_compile_options(${TARGET} PRIVATE -fno-inline -fno-builtin-printf -fno-common -Wno-implicit -funroll-loops -fpeel-loops -fgcse-sm -fgcse-las)
|
|
|
|
target_compile_definitions(${TARGET} PRIVATE ITERATIONS=${ITERATIONS} HZ=32768 TIME NO_INIT)
|
|
|
|
|
|
|
|
set(BOARD "iss" CACHE STRING "Target board")
|
|
|
|
add_subdirectory(../../bare-metal-bsp bsp)
|
|
|
|
target_link_libraries(${TARGET} PRIVATE bsp)
|
|
|
|
target_link_options(${TARGET} PRIVATE LINKER:--wrap=scanf)
|
|
|
|
include(CMakePrintHelpers)
|
|
|
|
cmake_print_properties(TARGETS ${TARGET} PROPERTIES COMPILE_DEFINITIONS COMPILE_OPTIONS LINK_OPTIONS INTERFACE_LINK_OPTIONS)
|
|
|
|
|
|
|
|
add_custom_command(TARGET ${TARGET} POST_BUILD
|
|
|
|
COMMAND ${CMAKE_OBJDUMP} -S ${TARGET}.elf > ${TARGET}.dis
|
|
|
|
COMMENT "Creating disassembly for ${TARGET}")
|