@@ -107,62 +107,57 @@ set(MICROPY_SOURCE_LIB_LIBM_SQRT_HW ${MICROPY_DIR}/lib/libm/thumb_vfp_sqrtf.c)
107
107
108
108
if (MICROPY_PY_BTREE)
109
109
set (MICROPY_LIB_BERKELEY_DIR "${MICROPY_DIR} /lib/berkeley-db-1.xx" )
110
- string (CONCAT GIT_SUBMODULES " ${GIT_SUBMODULES} " lib/berkeley-db-1.xx)
110
+ list ( APPEND GIT_SUBMODULES lib/berkeley-db-1.xx)
111
111
112
- if (ECHO_SUBMODULES)
113
- # No-op, we're just doing submodule/variant discovery.
114
- # Cannot run the add_library/target_include_directories rules (even though
115
- # the build won't run) because IDF will attempt verify the files exist.
116
- elseif (NOT EXISTS ${MICROPY_LIB_BERKELEY_DIR} /README)
112
+ if (NOT UPDATE_SUBMODULES AND NOT EXISTS ${MICROPY_LIB_BERKELEY_DIR} /README)
117
113
# Regular build, submodule not initialised -- fail with a clear error.
118
114
message (FATAL_ERROR " MICROPY_PY_BTREE is enabled but the berkeley-db submodule is not initialised.\n Run 'make BOARD=${MICROPY_BOARD} submodules'" )
119
- else ()
120
- # Regular build, we have the submodule.
121
- add_library (micropy_extmod_btree OBJECT
122
- ${MICROPY_LIB_BERKELEY_DIR} /btree/bt_close.c
123
- ${MICROPY_LIB_BERKELEY_DIR} /btree/bt_conv.c
124
- ${MICROPY_LIB_BERKELEY_DIR} /btree/bt_debug.c
125
- ${MICROPY_LIB_BERKELEY_DIR} /btree/bt_delete.c
126
- ${MICROPY_LIB_BERKELEY_DIR} /btree/bt_get.c
127
- ${MICROPY_LIB_BERKELEY_DIR} /btree/bt_open.c
128
- ${MICROPY_LIB_BERKELEY_DIR} /btree/bt_overflow.c
129
- ${MICROPY_LIB_BERKELEY_DIR} /btree/bt_page.c
130
- ${MICROPY_LIB_BERKELEY_DIR} /btree/bt_put.c
131
- ${MICROPY_LIB_BERKELEY_DIR} /btree/bt_search.c
132
- ${MICROPY_LIB_BERKELEY_DIR} /btree/bt_seq.c
133
- ${MICROPY_LIB_BERKELEY_DIR} /btree/bt_split.c
134
- ${MICROPY_LIB_BERKELEY_DIR} /btree/bt_utils.c
135
- ${MICROPY_LIB_BERKELEY_DIR} /mpool/mpool.c
136
- )
115
+ endif ()
137
116
138
- target_include_directories (micropy_extmod_btree PRIVATE
139
- ${MICROPY_LIB_BERKELEY_DIR} /include
140
- )
117
+ add_library (micropy_extmod_btree OBJECT
118
+ ${MICROPY_LIB_BERKELEY_DIR} /btree/bt_close.c
119
+ ${MICROPY_LIB_BERKELEY_DIR} /btree/bt_conv.c
120
+ ${MICROPY_LIB_BERKELEY_DIR} /btree/bt_debug.c
121
+ ${MICROPY_LIB_BERKELEY_DIR} /btree/bt_delete.c
122
+ ${MICROPY_LIB_BERKELEY_DIR} /btree/bt_get.c
123
+ ${MICROPY_LIB_BERKELEY_DIR} /btree/bt_open.c
124
+ ${MICROPY_LIB_BERKELEY_DIR} /btree/bt_overflow.c
125
+ ${MICROPY_LIB_BERKELEY_DIR} /btree/bt_page.c
126
+ ${MICROPY_LIB_BERKELEY_DIR} /btree/bt_put.c
127
+ ${MICROPY_LIB_BERKELEY_DIR} /btree/bt_search.c
128
+ ${MICROPY_LIB_BERKELEY_DIR} /btree/bt_seq.c
129
+ ${MICROPY_LIB_BERKELEY_DIR} /btree/bt_split.c
130
+ ${MICROPY_LIB_BERKELEY_DIR} /btree/bt_utils.c
131
+ ${MICROPY_LIB_BERKELEY_DIR} /mpool/mpool.c
132
+ )
141
133
142
- if ( NOT BERKELEY_DB_CONFIG_FILE)
143
- set (BERKELEY_DB_CONFIG_FILE " ${MICROPY_DIR} /extmod/berkeley-db/berkeley_db_config_port.h" )
144
- endif ( )
134
+ target_include_directories (micropy_extmod_btree PRIVATE
135
+ ${MICROPY_LIB_BERKELEY_DIR} / include
136
+ )
145
137
146
- target_compile_definitions (micropy_extmod_btree PRIVATE
147
- BERKELEY_DB_CONFIG_FILE= "${BERKELEY_DB_CONFIG_FILE} "
148
- )
138
+ if ( NOT BERKELEY_DB_CONFIG_FILE)
139
+ set ( BERKELEY_DB_CONFIG_FILE "${MICROPY_DIR} /extmod/berkeley-db/berkeley_db_config_port.h" )
140
+ endif ( )
149
141
150
- # The include directories and compile definitions below are needed to build
151
- # modbtree.c and should be added to the main MicroPython target.
142
+ target_compile_definitions (micropy_extmod_btree PRIVATE
143
+ BERKELEY_DB_CONFIG_FILE="${BERKELEY_DB_CONFIG_FILE} "
144
+ )
152
145
153
- list (APPEND MICROPY_INC_CORE
154
- "${MICROPY_LIB_BERKELEY_DIR} /include"
155
- )
146
+ # The include directories and compile definitions below are needed to build
147
+ # modbtree.c and should be added to the main MicroPython target.
156
148
157
- list (APPEND MICROPY_DEF_CORE
158
- MICROPY_PY_BTREE=1
159
- BERKELEY_DB_CONFIG_FILE="${BERKELEY_DB_CONFIG_FILE} "
160
- )
149
+ list (APPEND MICROPY_INC_CORE
150
+ "${MICROPY_LIB_BERKELEY_DIR} /include"
151
+ )
161
152
162
- list (APPEND MICROPY_SOURCE_EXTMOD
163
- ${MICROPY_EXTMOD_DIR} /modbtree.c
164
- )
165
- endif ()
153
+ list (APPEND MICROPY_DEF_CORE
154
+ MICROPY_PY_BTREE=1
155
+ BERKELEY_DB_CONFIG_FILE="${BERKELEY_DB_CONFIG_FILE} "
156
+ )
157
+
158
+ list (APPEND MICROPY_SOURCE_EXTMOD
159
+ ${MICROPY_EXTMOD_DIR} /modbtree.c
160
+ )
166
161
endif ()
167
162
168
163
# Library for mbedtls
@@ -350,5 +345,5 @@ if(MICROPY_PY_LWIP)
350
345
${MICROPY_LIB_LWIP_DIR} /include
351
346
)
352
347
353
- string (CONCAT GIT_SUBMODULES " ${GIT_SUBMODULES} " lib/lwip)
348
+ list ( APPEND GIT_SUBMODULES lib/lwip)
354
349
endif ()
0 commit comments