aboutsummaryrefslogtreecommitdiff
path: root/nrf5x
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2017-01-26 14:30:07 +0100
committerTrygve Laugstøl <trygvis@inamo.no>2017-01-26 14:30:07 +0100
commitba679f16fff7787840fd3536dc265dda39f1886c (patch)
tree8685cf9c9391fa33fed4ca88c233752307016ac2 /nrf5x
parent19f3ed1b073e743345639c3bf0b9204697394c42 (diff)
downloadmcu.cmake-ba679f16fff7787840fd3536dc265dda39f1886c.tar.gz
mcu.cmake-ba679f16fff7787840fd3536dc265dda39f1886c.tar.bz2
mcu.cmake-ba679f16fff7787840fd3536dc265dda39f1886c.tar.xz
mcu.cmake-ba679f16fff7787840fd3536dc265dda39f1886c.zip
nrf5x: Support for using your own startup files instead of the ones from the SDK.HEADmaster
Diffstat (limited to 'nrf5x')
-rw-r--r--nrf5x/utils.cmake16
1 files changed, 11 insertions, 5 deletions
diff --git a/nrf5x/utils.cmake b/nrf5x/utils.cmake
index 2ee62ae..e8bd92a 100644
--- a/nrf5x/utils.cmake
+++ b/nrf5x/utils.cmake
@@ -18,7 +18,7 @@ function(mcu_add_executable)
# message("mcu_add_executable: ARGN=${ARGN}")
set(options)
- set(oneValueArgs TARGET SDK_CONFIG SOFTDEVICE LINKER_SCRIPT)
+ set(oneValueArgs TARGET SDK_CONFIG SOFTDEVICE LINKER_SCRIPT STARTUP_FILES)
set(multiValueArgs)
cmake_parse_arguments(ARGS "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
@@ -27,9 +27,9 @@ function(mcu_add_executable)
endif ()
if (ARGS_LINKER_SCRIPT)
- if(NOT IS_ABSOLUTE "${ARGS_LINKER_SCRIPT}")
+ if (NOT IS_ABSOLUTE "${ARGS_LINKER_SCRIPT}")
set(ARGS_LINKER_SCRIPT "${CMAKE_CURRENT_SOURCE_DIR}/${ARGS_LINKER_SCRIPT}")
- endif()
+ endif ()
set_target_properties(${ARGS_TARGET} PROPERTIES MCU_LINKER_SCRIPT "${ARGS_LINKER_SCRIPT}")
endif ()
@@ -46,8 +46,14 @@ function(mcu_add_executable)
set_target_properties(${ARGS_TARGET} PROPERTIES MCU_NRF5X_CHIP_SERIES "${chip_series}")
endif ()
- _nrf5_startup_files(${ARGS_TARGET} STARTUP_FILES)
- target_sources(${ARGS_TARGET} PUBLIC ${STARTUP_FILES})
+ if (NOT DEFINED ARGS_STARTUP_FILES)
+ set(ARGS_STARTUP_FILES "auto")
+ endif ()
+
+ if (ARGS_STARTUP_FILES STREQUAL "auto")
+ _nrf5_startup_files(${ARGS_TARGET} STARTUP_FILES)
+ target_sources(${ARGS_TARGET} PUBLIC ${STARTUP_FILES})
+ endif ()
target_compile_options(${ARGS_TARGET} PUBLIC -Wall -Werror -g3 -O3)