Skip to content

Commit 8e37f1b

Browse files
committed
Swapped the ZIP_LISTS implementation for a plain CMake one, to allow builds on older CMake versions. Also only now halting the build if SOFTDEVICE_PRESENT is asserted with any value and DEVICE_BLE is not 1, and would therefore be an invalid, unbootable configuration
1 parent 75a0620 commit 8e37f1b

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

CMakeLists.txt

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,22 @@ project(codal-microbit-v2)
33
# Actually merge our multiple configs into a single set of values so we can query them easily.
44
# Note: This will be removed when we move to a library-ified version of the build system
55
# so do not rely on it for anything.
6-
foreach( _key _val IN ZIP_LISTS FINAL_FIELDS FINAL_VALUES )
6+
#
7+
# Note: This form of loop isn't available until we move to at least CMake 3.17+, so the second form
8+
# below has been added to do the same, in a more verbose way.
9+
#foreach( _key _val IN ZIP_LISTS FINAL_FIELDS FINAL_VALUES )
10+
# set( "__merged.config.${_key}" "${_val}" )
11+
#endforeach()
12+
13+
LIST( LENGTH FINAL_FIELDS _idxMax )
14+
MATH( EXPR _idxMax "${_idxMax} - 1" )
15+
foreach( _index RANGE ${_idxMax} )
16+
LIST( GET FINAL_FIELDS ${_index} _key )
17+
LIST( GET FINAL_VALUES ${_index} _val )
718
set( "__merged.config.${_key}" "${_val}" )
819
endforeach()
920

10-
if( DEFINED __merged.config.SOFTDEVICE_PRESENT )
21+
if( DEFINED __merged.config.SOFTDEVICE_PRESENT AND NOT "${__merged.config.DEVICE_BLE}" STREQUAL "1" )
1122
message( FATAL_ERROR "Do not define SOFTDEVICE_PRESENT in your configuration, use DEVICE_BLE instead." )
1223
endif()
1324

0 commit comments

Comments
 (0)