Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Updated toolchain specific compilation flags
  • Loading branch information
coder137 committed Jan 23, 2021
commit 824cceaebe29af99cafcb50d2f16ef4ebde70681
16 changes: 13 additions & 3 deletions Template/Minimal_Tools/cmake/compile_flags.cmake
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
# ~~~
# https://gcc.gnu.org/onlinedocs/gcc-3.2/gcc/Warning-Options.html#Warning%20Options
# ~~~
set(WARNING_FLAGS -Wall -Werror)
set(WARNING_FLAGS
-Wall
-Werror
-Wno-format
)

# Project Variables
set(COMMON_C_FLAGS
Expand All @@ -14,8 +18,14 @@ set(COMMON_C_FLAGS
-pipe
-Wl,--print-memory-usage
${WARNING_FLAGS})
set(USER_C_FLAGS -std=c99 -fmessage-length=0 -ffunction-sections
-fdata-sections -fstack-usage -nostdlib)
set(USER_C_FLAGS
-std=c11
-fmessage-length=0
-ffunction-sections
-fdata-sections
-fstack-usage
-nostdlib
)

set(USER_LINK_FLAGS
-nostartfiles
Expand Down
6 changes: 4 additions & 2 deletions Template/Minimal_Tools/cmake/toolchain.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,7 @@ set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
# ~~~
set(CMAKE_C_COMPILER arm-none-eabi-gcc)
set(CMAKE_CXX_COMPILER arm-none-eabi-g++)
set(CMAKE_C_COMPILER_WORKS 1)
set(CMAKE_CXX_COMPILER_WORKS 1)

# This is necessary to populate `CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES`
# a lot of tools could potentitally require cmake variable
set(CMAKE_TRY_COMPILE_TARGET_TYPE "STATIC_LIBRARY")