29 lines
1.1 KiB
CMake
29 lines
1.1 KiB
CMake
cmake_minimum_required(VERSION 3.21)
|
|
project(dhrystone C)
|
|
set(TARGET dhrystone)
|
|
|
|
set(ITERATIONS 50000 CACHE STRING "")
|
|
set(FREQ 100e6 CACHE STRING "")
|
|
|
|
set(CMAKE_C_FLAGS_RELEASE -O3)
|
|
|
|
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
|
|
-Wno-implicit -fno-builtin-printf
|
|
-finline -fno-common -funroll-loops -fpeel-loops
|
|
-finline-functions -finline-limit=1000
|
|
-fgcse-sm -fgcse-las
|
|
-falign-functions=16 -falign-jumps=4 -falign-loops=4
|
|
-freorder-blocks-and-partition -fno-if-conversion2 -fno-crossjumping)
|
|
target_compile_definitions(${TARGET} PRIVATE ITERATIONS=${ITERATIONS} HZ=${FREQ} 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:-Map=${TARGET}.map -Wl,--wrap=scanf)
|
|
|
|
add_custom_command(TARGET ${TARGET} POST_BUILD
|
|
COMMAND ${CMAKE_OBJDUMP} -S ${TARGET}.elf > ${TARGET}.dis
|
|
COMMENT "Creating disassembly for ${TARGET}")
|