Firmwares/benchmarks/coremark/CMakeLists.txt

37 lines
1.6 KiB
CMake
Raw Normal View History

2025-02-20 14:08:53 +01:00
cmake_minimum_required(VERSION 3.21)
2024-12-17 12:34:07 +01:00
project(coremark C)
2025-02-20 14:08:53 +01:00
set(TARGET coremark)
set(CMAKE_BUILD_TYPE Release)
2024-12-17 12:34:07 +01:00
# Source files
set(SOURCES
core_portme.c
cvt.c
ee_printf.c
cm/core_list_join.c
cm/core_main.c
cm/core_matrix.c
cm/core_state.c
cm/core_util.c
)
2025-02-20 14:08:53 +01:00
2024-12-17 12:34:07 +01:00
# Create executable
add_executable(coremark ${SOURCES})
2025-02-20 14:08:53 +01:00
target_include_directories(${TARGET} PRIVATE ${CMAKE_CURRENT_LIST_DIR} ${CMAKE_CURRENT_LIST_DIR}/cm)
target_compile_options(${TARGET} PRIVATE -Wno-pointer-to-int-cast -Wno-int-to-pointer-cast -fno-common -funroll-loops -finline-functions -falign-functions=16 -falign-jumps=4 -falign-loops=4 -finline-limit=1000 -fno-if-conversion2 -fselective-scheduling -fno-crossjumping -freorder-blocks-and-partition -Wno-pointer-to-int-cast -Wno-int-to-pointer-cast -fno-common -funroll-loops -finline-functions -falign-functions=16 -falign-jumps=4 -falign-loops=4 -finline-limit=1000 -fno-if-conversion2 -fselective-scheduling -fno-crossjumping -freorder-blocks-and-partition )
target_compile_definitions(${TARGET} PRIVATE PERFORMANCE_RUN=1 CLOCKS_PER_SEC=10000000 FLAGS_STR="" PERFORMANCE_RUN=1 CLOCKS_PER_SEC=10000000 ITERATIONS=600)
2024-12-17 12:34:07 +01:00
2025-02-20 14:08:53 +01:00
set(BOARD "iss" CACHE STRING "Target board")
add_subdirectory(../../bare-metal-bsp bsp)
target_link_libraries(${TARGET} PRIVATE bsp)
2024-12-17 12:34:07 +01:00
2025-02-20 14:08:53 +01:00
include(CMakePrintHelpers)
cmake_print_properties(TARGETS ${TARGET} PROPERTIES COMPILE_DEFINITIONS COMPILE_OPTIONS LINK_OPTIONS INTERFACE_LINK_OPTIONS)
2024-12-17 12:34:07 +01:00
2025-02-20 14:08:53 +01:00
add_custom_command(TARGET ${TARGET} POST_BUILD
COMMAND ${CMAKE_OBJDUMP} -S ${TARGET}.elf > ${TARGET}.dis
COMMENT "Creating disassembly for ${TARGET}")