## LIST OF CMAKE VARIABLES THAT CAN BE PASSED TO MBTLE

if(BUILD_HOST)
    set(AES_USE_HARDWARE 0)
    set(LOG_ENABLE_RTT   0)
    set(LOG_CALLBACK_DEFAULT                  "log_callback_stdout"                                               CACHE STRING "Default log callback")
else()
    set(LOG_CALLBACK_DEFAULT                  "log_callback_rtt"                                                  CACHE STRING "Default log callback")
endif()

if((NOT BUILD_HOST) AND ((CMAKE_BUILD_TYPE MATCHES "Debug") OR (CMAKE_BUILD_TYPE MATCHES "RelWithDebInfo")))
    set(INTERNAL_EVT_ENABLE 1)
else()
    set(INTERNAL_EVT_ENABLE 0)
endif()


## README
# If any of the variables listed below are defined
# they will be passed to all compiled targets.

set (CMAKE_INPUTS
    #MBTLE_CORE
        NRF_MESH_PACKET_QUEUE_SIZE
        NRF_MESH_ADV_CHAN_DEFAULT
        NRF_MESH_BEACON_SECURE_NET_BCAST_INTERVAL
        BEACON_DEFAULT_INTERVAL
        AES_SOFT_VERSION
        BEARER_TYPES
        BEARER_ADV_REPEAT_DEFAULT
        BEARER_TX_QUEUE_LENGTH
        BEARER_RX_QUEUE_LENGTH
        BEARER_ADV_INT_MIN_MS_DEFAULT
        BEARER_ADV_INT_MAX_MS_DEFAULT
        BEARER_ADV_ACCESS_ADDR
        BEARER_EVENT_FIFO_SIZE
        EVENT_QUEUE_SIZE
        INTERNAL_EVENT_BUFFER_SIZE
        LOG_LEVEL_DEFAULT
        LOG_MSK_DEFAULT
        MSG_CACHE_ENTRY_COUNT
        NETWORK_BEARER
        NETWORK_IV_RECOVERY_LIMIT
        NETWORK_SEQNUM_THRESHOLD
        NETWORK_MIN_IV_UPDATE_INTERVAL
        PACKET_MGR_MEMORY_POOL_SIZE
        REPLAY_CACHE_ENTRIES
    ## MBTLE_PROV
        NRF_MESH_UECC_ENABLE
    ## MBTLE_PB_REM
        ACCESS_MODEL_SUBSCRIPTIONS_MAX
        ACCESS_MODEL_APPLICATIONS_MAX
        ACCESS_TTL_DEFAULT
        ACCESS_TIMEOUT_MARGIN
        NRF_MESH_PROV_MESH_ACK_TIMEOUT
        NRF_MESH_PROV_MESH_SERVER_UUID_LIST_SIZE
    ## MBTLE_SRCS_SERIAL
        SERIAL_RX_FIFO_SIZE
        SERIAL_TX_FIFO_SIZE
    ## MBTLE_DFU
        NRF_MESH_DFU_ENABLE
        NRF_MESH_DFU_TX_SLOTS
    #DEBUG
        PROV_DEBUG_MODE
        PB_REMOTE_DEBUG_VERBOSE
        BEARER_ASSERT_ON_WRONG_RX_LENGTH
        AES_USE_HARDWARE
        NRF_MESH_SERIAL_ENABLE
        NRF_MESH_STACK_DEPTH
        NRF_MESH_TEST_BUILD
        CCM_DEBUG_MODE_ENABLED
        NRF_MESH_LOG_ENABLE
        LOG_ENABLE_RTT
        NETWORK_CACHE_ENABLE
        NETWORK_IV_RECOVERY_LIMIT_ENABLE
        PACKET_MGR_DEBUG_MODE
        PACKET_MGR_BLAME_MODE
        RADIO_DEBUG_MODE
        LOG_CALLBACK_DEFAULT
        INTERNAL_EVT_ENABLE
    )

foreach(CONFIG_DEF IN LISTS CMAKE_INPUTS)
    if(DEFINED ${CONFIG_DEF})
        set(MBTLE_DEFINITIONS
            ${MBTLE_DEFINITIONS}
            "-D${CONFIG_DEF}=${${CONFIG_DEF}}"
            CACHE INTERNAL "")
    endif()
endforeach()
