Created
October 1, 2019 23:24
-
-
Save shuffle2/1a23f69496f6e9b40ccb8b6c856307b9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# arm core is ARM7TDMI-S | |
set(CMAKE_SYSTEM_NAME Generic) | |
set(CMAKE_C_COMPILER arm-none-eabi-gcc) | |
set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY) | |
#set(CMAKE_C_STANDARD 11) | |
#set(CMAKE_C_EXTENSIONS, TRUE) | |
#set(CMAKE_C_STANDARD_REQUIRED ON) | |
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) | |
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) | |
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) | |
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) | |
set(ARCH_FLAGS "-g -mcpu=arm7tdmi-s -mthumb -masm-syntax-unified -mabi=aapcs") | |
# can help BOOT code size when using otherwise low opt level: | |
# -fsection-anchors -mpic-data-is-text-relative | |
# -flto seems to break binary layout :/ | |
# consider disabling auto inlining of small functions, etc | |
set(OPT_FLAGS "-O2 -ffunction-sections -fdata-sections -fomit-frame-pointer") | |
set(WARN_FLAGS "") | |
set(OBJ_FLAGS "${ARCH_FLAGS} ${OPT_FLAGS} ${WARN_FLAGS}") | |
set(CMAKE_C_FLAGS "${OBJ_FLAGS} -std=c99 -fsigned-char" CACHE INTERNAL "C Compiler options") | |
set(CMAKE_ASM_FLAGS "${ARCH_FLAGS}" CACHE INTERNAL "ASM Compiler options") | |
set(CMAKE_EXE_LINKER_FLAGS "--specs=nano.specs --specs=nosys.specs -Wl,--gc-sections -nostartfiles" | |
CACHE INTERNAL "Linker options") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment