Adding experimental clang compiler support for arm-none-eabi

- Currently builds larger binaries than gcc (RAM)
This commit is contained in:
Jacob Alexander 2014-12-31 19:42:16 -08:00
parent f5a1e1bcf5
commit 621d8736e7
3 changed files with 50 additions and 8 deletions

View file

@ -33,22 +33,33 @@ set_target_properties( ${TARGET_ELF} PROPERTIES
SUFFIX "" # XXX Force Windows to keep the .exe off
)
#| llvm-clang does not have an objcopy equivalent
if ( "${COMPILER}" MATCHES "clang" )
if ( "${COMPILER_FAMILY}" MATCHES "arm" )
set ( OBJ_COPY arm-none-eabi-objcopy )
elseif ( "${COMPILER_FAMILY}" MATCHES "arm" )
set ( OBJ_COPY avr-objcopy )
endif ()
else ()
set ( OBJ_COPY ${CMAKE_OBJCOPY} )
endif ()
#| Convert the .ELF into a .bin to load onto the McHCK
if( DEFINED DFU )
if ( DEFINED DFU )
set( TARGET_BIN ${TARGET}.dfu.bin )
add_custom_command( TARGET ${TARGET_ELF} POST_BUILD
COMMAND ${CMAKE_OBJCOPY} ${BIN_FLAGS} ${TARGET_ELF} ${TARGET_BIN}
COMMAND ${OBJ_COPY} ${BIN_FLAGS} ${TARGET_ELF} ${TARGET_BIN}
COMMENT "Creating dfu binary file: ${TARGET_BIN}"
)
endif()
endif ()
#| Convert the .ELF into a .HEX to load onto the Teensy
if ( DEFINED TEENSY )
set( TARGET_HEX ${TARGET}.teensy.hex )
add_custom_command( TARGET ${TARGET_ELF} POST_BUILD
COMMAND ${CMAKE_OBJCOPY} ${HEX_FLAGS} ${TARGET_ELF} ${TARGET_HEX}
COMMAND ${OBJ_COPY} ${HEX_FLAGS} ${TARGET_ELF} ${TARGET_HEX}
COMMENT "Creating iHex file to load: ${TARGET_HEX}"
)
endif()