From dcb3fb560f37d27a51feb8d5f3ba83d62951c06d Mon Sep 17 00:00:00 2001 From: Jacob Alexander Date: Sun, 7 Aug 2016 12:51:13 -0700 Subject: [PATCH] Small cleanup --- Lib/CMake/arm.cmake | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/Lib/CMake/arm.cmake b/Lib/CMake/arm.cmake index fd5eecd..da1aebc 100644 --- a/Lib/CMake/arm.cmake +++ b/Lib/CMake/arm.cmake @@ -190,19 +190,31 @@ set( WARN "-Wall -ggdb3" ) #| Tuning Options #| -f...: tuning, see GCC manual #| NOTE: -fshort-wchar is specified to allow USB strings be passed conveniently +#| Bootloader Compiler Flags if( BOOTLOADER ) + + ## Clang Compiler if ( "${COMPILER}" MATCHES "clang" ) # TODO Not currently working, clang doesn't support all the neccessary extensions message ( AUTHOR_WARNING "clang doesn't support all the needed extensions, code may need rework to use clang" ) set ( TUNING "-D_bootloader_ -Wno-main -msoft-float -target arm-none-eabi -mthumb -nostdlib -fdata-sections -ffunction-sections -fshort-wchar -fno-builtin -fplan9-extensions -fstrict-volatile-bitfields -flto -fno-use-linker-plugin" ) + + ## GCC Compiler else () set ( TUNING "-D_bootloader_ -Wno-main -msoft-float -mthumb -fplan9-extensions -ffunction-sections -fdata-sections -fno-builtin -fstrict-volatile-bitfields -flto -fno-use-linker-plugin -nostdlib" ) #set( TUNING "-mthumb -fdata-sections -ffunction-sections -fno-builtin -msoft-float -fstrict-volatile-bitfields -flto -fno-use-linker-plugin -fwhole-program -Wno-main -nostartfiles -fplan9-extensions -D_bootloader_" ) endif () -elseif ( "${COMPILER}" MATCHES "clang" ) - set ( TUNING "-target arm-none-eabi -mthumb -nostdlib -fdata-sections -ffunction-sections -fshort-wchar -fno-builtin" ) -else() - set( TUNING "-mthumb -nostdlib -fdata-sections -ffunction-sections -fshort-wchar -fno-builtin -nostartfiles" ) + +#| Firmware Compiler Flags +else () + ## Clang Compiler + if ( "${COMPILER}" MATCHES "clang" ) + set ( TUNING "-target arm-none-eabi -mthumb -nostdlib -fdata-sections -ffunction-sections -fshort-wchar -fno-builtin" ) + + ## GCC Compiler + else() + set( TUNING "-mthumb -nostdlib -fdata-sections -ffunction-sections -fshort-wchar -fno-builtin -nostartfiles" ) + endif () endif()