function(post_source_hw_os_config) set(C_FLAGS "" CACHE INTERNAL "C flags") set(C_DEFS "" CACHE INTERNAL "C Defines" ) set(CXX_FLAGS ${C_FLAGS}) set(CXX_DEFS ${C_DEFS}) if(CMAKE_VERBOSE) message(STATUS "C Flags: ${C_FLAGS}") message(STATUS "CXX Flags: ${CXX_FLAGS}") message(STATUS "C Defs: ${C_DEFS}") message(STATUS "CXX Defs: ${CXX_DEFS}") endif() # Generator expression. Can be used to set different C, CXX and ASM flags. target_compile_options(${TARGET_NAME} PRIVATE $<$:${C_DEFS} ${C_FLAGS}> $<$:${CXX_DEFS} ${CXX_FLAGS}> $<$:${ASM_FLAGS}> ) add_custom_command( TARGET ${TARGET_NAME} POST_BUILD COMMAND echo Generating binary file ${CMAKE_PROJECT_NAME}.bin.. COMMAND ${CMAKE_OBJCOPY} -O binary ${TARGET_NAME} ${TARGET_NAME}.bin ) endfunction()