aboutsummaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2016-01-02 20:53:42 +0100
committerTrygve Laugstøl <trygvis@inamo.no>2016-01-02 20:53:42 +0100
commit9129af503c8211d713c8a160a3b6f3f86b328639 (patch)
tree3cd9ff26f4d323fc553b2a99d56be9b81a57a4c4 /cmake
parentaae314fead54dab7b258f3a6c7ac1615833f9987 (diff)
downloadstm32f103-playground-9129af503c8211d713c8a160a3b6f3f86b328639.tar.gz
stm32f103-playground-9129af503c8211d713c8a160a3b6f3f86b328639.tar.bz2
stm32f103-playground-9129af503c8211d713c8a160a3b6f3f86b328639.tar.xz
stm32f103-playground-9129af503c8211d713c8a160a3b6f3f86b328639.zip
o Adding a utility to dump segment sizes from the generated ELF files.
o Adding os2 with support for critical sections. More to come. o Adding dma1 to test DMA + SPI.
Diffstat (limited to 'cmake')
-rw-r--r--cmake/stm32.toolchain.cmake20
1 files changed, 7 insertions, 13 deletions
diff --git a/cmake/stm32.toolchain.cmake b/cmake/stm32.toolchain.cmake
index fb1cc57..ab73d90 100644
--- a/cmake/stm32.toolchain.cmake
+++ b/cmake/stm32.toolchain.cmake
@@ -27,21 +27,15 @@ set(BASE_FLAGS "-Wall -g -ffunction-sections -fdata-sections ${TARGET_FLAGS}")
set(CMAKE_C_FLAGS "${BASE_FLAGS}" CACHE STRING "c flags") # XXX Generate TIME_T dynamically.
set(CMAKE_CXX_FLAGS "${BASE_FLAGS} -fno-exceptions -fno-rtti -felide-constructors -std=c++14" CACHE STRING "c++ flags")
-#set(LINKER_FLAGS "-Os -Wl,--gc-sections ${TARGET_FLAGS} -T${TEENSY_ROOT}/mk20dx256.ld")
-#set(LINKER_FLAGS "-Os -Wl,--gc-sections ${TARGET_FLAGS}")
-set(LINKER_FLAGS "-O0 -Wl,--gc-sections ${TARGET_FLAGS}")
-set(LINKER_FLAGS "-O0 ${TARGET_FLAGS}")
+set(LINKER_FLAGS "-O3 ${TARGET_FLAGS}")
set(LINKER_LIBS "-larm_cortexM4l_math -lm")
-#set(CMAKE_SHARED_LINKER_FLAGS "${LINKER_FLAGS}" CACHE STRING "linker flags" FORCE)
-#set(CMAKE_MODULE_LINKER_FLAGS "${LINKER_FLAGS}" CACHE STRING "linker flags" FORCE)
+
set(CMAKE_EXE_LINKER_FLAGS "${LINKER_FLAGS}" CACHE STRING "linker flags" FORCE)
-CMAKE_FORCE_C_COMPILER("${TOOLCHAIN_ROOT}/bin/${TRIPLE}-gcc" GNU)
-CMAKE_FORCE_CXX_COMPILER("${TOOLCHAIN_ROOT}/bin/${TRIPLE}-g++" GNU)
+cmake_force_c_compiler("${TOOLCHAIN_ROOT}/bin/${TRIPLE}-gcc" GNU)
+cmake_force_cxx_compiler("${TOOLCHAIN_ROOT}/bin/${TRIPLE}-g++" GNU)
# search for programs in the build host directories
-SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
+set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
# for libraries and headers in the target directories
-SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
-SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
-
-# add_definitions(-MMD)
+set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
+set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)