mirror of
https://github.com/apache/nuttx.git
synced 2026-06-05 15:58:59 +08:00
cmake: fix nrf91 modem static library build
This commit is contained in:
@@ -89,7 +89,7 @@ endif()
|
|||||||
|
|
||||||
if(CONFIG_NRF91_MODEM)
|
if(CONFIG_NRF91_MODEM)
|
||||||
|
|
||||||
set(NRFXLIB_VER "2.3.0")
|
set(NRFXLIB_VER "2.4.0")
|
||||||
set(NRFXLIB_URL "https://github.com/nrfconnect/sdk-nrfxlib/archive")
|
set(NRFXLIB_URL "https://github.com/nrfconnect/sdk-nrfxlib/archive")
|
||||||
|
|
||||||
if(NOT EXISTS ${CMAKE_CURRENT_LIST_DIR}/sdk-nrfxlib)
|
if(NOT EXISTS ${CMAKE_CURRENT_LIST_DIR}/sdk-nrfxlib)
|
||||||
@@ -120,16 +120,14 @@ if(NOT EXISTS ${CMAKE_CURRENT_LIST_DIR}/sdk-nrfxlib)
|
|||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(NRFXLIB_DIR "${NUTTX_CHIP_ABS_DIR}/sdk-nrfxlib")
|
list(APPEND SRCS nrf91_modem.c nrf91_modem_os.c nrf91_nrfx_ipc.c)
|
||||||
|
|
||||||
target_include_directories(arch PRIVATE ${NRFXLIB_DIR}/nrf_modem/include)
|
|
||||||
|
|
||||||
list(APPEND SRCS nrf53_modem.c nrf53_modem_os.c nrf53_nrfx_ipc.c)
|
|
||||||
|
|
||||||
if(CONFIG_NRF91_MODEM_AT)
|
if(CONFIG_NRF91_MODEM_AT)
|
||||||
list(APPEND SRCS nrf91_modem_at.c)
|
list(APPEND SRCS nrf91_modem_at.c)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
set(NRFXLIB_DIR "${NUTTX_CHIP_ABS_DIR}/sdk-nrfxlib")
|
||||||
|
|
||||||
if(CONFIG_ARCH_FPU)
|
if(CONFIG_ARCH_FPU)
|
||||||
set(NRFXLIB_LIB_VARIANT hard-float)
|
set(NRFXLIB_LIB_VARIANT hard-float)
|
||||||
else ()
|
else ()
|
||||||
@@ -142,9 +140,12 @@ else()
|
|||||||
set(MODEM_LIB_VARIANT libmodem_log.a)
|
set(MODEM_LIB_VARIANT libmodem_log.a)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
target_link_libraries(arch
|
nuttx_library_import(modem
|
||||||
${NRFXLIB_DIR}/nrf_modem/lib/cortex-m33+nodsp/${NRFXLIB_LIB_VARIANT}/${MODEM_LIB_VARIANT})
|
${NRFXLIB_DIR}/nrf_modem/lib/cortex-m33/${NRFXLIB_LIB_VARIANT}/${MODEM_LIB_VARIANT})
|
||||||
|
target_include_directories(arch PRIVATE ${NRFXLIB_DIR}/nrf_modem/include)
|
||||||
|
|
||||||
|
target_link_libraries(arch PRIVATE modem)
|
||||||
|
target_link_libraries(modem INTERFACE arch c)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
target_sources(arch PRIVATE ${SRCS})
|
target_sources(arch PRIVATE ${SRCS})
|
||||||
|
|||||||
@@ -175,3 +175,12 @@ function(nuttx_add_library target)
|
|||||||
|
|
||||||
nuttx_add_library_internal(${target})
|
nuttx_add_library_internal(${target})
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
|
# Import static library
|
||||||
|
#
|
||||||
|
function(nuttx_library_import library_name library_path)
|
||||||
|
add_library(${library_name} STATIC IMPORTED GLOBAL)
|
||||||
|
set_target_properties(${library_name}
|
||||||
|
PROPERTIES IMPORTED_LOCATION
|
||||||
|
${library_path})
|
||||||
|
endfunction()
|
||||||
|
|||||||
Reference in New Issue
Block a user