diff options
| author | Damien George <damien@micropython.org> | 2022-06-08 12:21:51 +1000 |
|---|---|---|
| committer | Damien George <damien@micropython.org> | 2022-06-08 13:03:34 +1000 |
| commit | bd375df02cfacff82b8c74f4adabeb0cade9a496 (patch) | |
| tree | d69c7c8e17fd4e58554bdb9e8d6137fb72252e7c /extmod | |
| parent | e8e8c7c3548623e586f44ff208ba3f7699b7f3c2 (diff) | |
extmod/extmod.cmake: Require components to be explicitly enabled.
Otherwise include directories are added unconditionally to the build
variables if the component (submodule) is checked out. This can lead to,
eg, the esp32 build using lib/lwip header files, instead of lwip header
files from the IDF.
Fixes issue #8727.
Signed-off-by: Damien George <damien@micropython.org>
Diffstat (limited to 'extmod')
| -rw-r--r-- | extmod/extmod.cmake | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/extmod/extmod.cmake b/extmod/extmod.cmake index 2d943f814..862743c1e 100644 --- a/extmod/extmod.cmake +++ b/extmod/extmod.cmake @@ -54,9 +54,9 @@ set(MICROPY_SOURCE_EXTMOD # Library for btree module and associated code -set(MICROPY_LIB_BERKELEY_DIR "${MICROPY_DIR}/lib/berkeley-db-1.xx") +if(MICROPY_PY_BTREE) + set(MICROPY_LIB_BERKELEY_DIR "${MICROPY_DIR}/lib/berkeley-db-1.xx") -if(EXISTS "${MICROPY_LIB_BERKELEY_DIR}/btree/bt_close.c") add_library(micropy_extmod_btree OBJECT ${MICROPY_LIB_BERKELEY_DIR}/btree/bt_close.c ${MICROPY_LIB_BERKELEY_DIR}/btree/bt_conv.c @@ -100,11 +100,11 @@ endif() # Library for mbedtls -set(MICROPY_LIB_MBEDTLS_DIR "${MICROPY_DIR}/lib/mbedtls") - -if(EXISTS "${MICROPY_LIB_MBEDTLS_DIR}/library/aes.c") +if(MICROPY_SSL_MBEDTLS) add_library(micropy_lib_mbedtls INTERFACE) + set(MICROPY_LIB_MBEDTLS_DIR "${MICROPY_DIR}/lib/mbedtls") + target_include_directories(micropy_lib_mbedtls INTERFACE ${MICROPY_LIB_MBEDTLS_DIR}/include ) @@ -194,11 +194,11 @@ endif() # Library for lwIP network stack -set(MICROPY_LIB_LWIP_DIR "${MICROPY_DIR}/lib/lwip/src") - -if(EXISTS "${MICROPY_LIB_LWIP_DIR}/core/def.c") +if(MICROPY_PY_LWIP) add_library(micropy_lib_lwip INTERFACE) + set(MICROPY_LIB_LWIP_DIR "${MICROPY_DIR}/lib/lwip/src") + target_include_directories(micropy_lib_lwip INTERFACE ${MICROPY_LIB_LWIP_DIR}/include ) |
