Skip to content

Commit

Permalink
Make build.
Browse files Browse the repository at this point in the history
Signed-off-by: Benjamin Perseghetti <[email protected]>
  • Loading branch information
bperseghetti committed Jul 20, 2024
1 parent 0209dcf commit adc3232
Showing 1 changed file with 17 additions and 10 deletions.
27 changes: 17 additions & 10 deletions port/platform/zephyr/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
# file should create an ubxlib library instead.
if(CONFIG_UBXLIB)

zephyr_library_named(ubxlib)

# we need to be able to include generated header files
zephyr_include_directories()

get_filename_component(UBXLIB_BASE ../../../ ABSOLUTE)
set(ENV{UBXLIB_BASE} ${UBXLIB_BASE})

Expand All @@ -14,7 +19,7 @@ list(APPEND ZEPHYR_EXTRA_MODULES ${UBXLIB_BASE}/drivers)
# Add environment variables passed-in via U_FLAGS
if (DEFINED ENV{U_FLAGS})
separate_arguments(U_FLAGS NATIVE_COMMAND "$ENV{U_FLAGS}")
target_compile_options(app PRIVATE ${U_FLAGS})
target_compile_options(ubxlib PRIVATE ${U_FLAGS})
message("ubxlib: added ${U_FLAGS} due to environment variable U_FLAGS.")
endif()

Expand Down Expand Up @@ -55,7 +60,7 @@ endif()
include(${UBXLIB_BASE}/port/ubxlib.cmake)

# Set ubxlib source files
target_sources(app PRIVATE
target_sources(ubxlib PRIVATE
${UBXLIB_SRC}
src/u_port.c
src/u_port_debug.c
Expand All @@ -71,7 +76,7 @@ target_sources(app PRIVATE
)

if (CONFIG_UBXLIB_OPEN_CPU_BLE)
target_sources(app PRIVATE src/u_port_gatt.c)
target_sources(ubxlib PRIVATE src/u_port_gatt.c)
endif()

# Set the include directories
Expand All @@ -89,9 +94,9 @@ target_compile_options(app PRIVATE ${UBXLIB_COMPILE_OPTIONS})

# Add test source & include dirs if selected
if (CONFIG_UBXLIB_TEST)
target_compile_definitions(app PRIVATE UNITY_INCLUDE_CONFIG_H)
target_compile_definitions(ubxlib PRIVATE UNITY_INCLUDE_CONFIG_H)

target_sources(app PRIVATE
target_sources(ubxlib PRIVATE
${UBXLIB_TEST_SRC}
test/u_zephyr_ppp_test.c
${UBXLIB_BASE}/example/sockets/main_ppp_zephyr.c
Expand Down Expand Up @@ -124,7 +129,7 @@ if (CONFIG_UBXLIB_TEST)

if (DEFINED UNITY_PATH)
message("Unity from ${UNITY_PATH} will be used")
target_sources(app PRIVATE
target_sources(ubxlib PRIVATE
${UNITY_PATH}/src/unity.c
)
zephyr_include_directories(
Expand All @@ -135,8 +140,10 @@ if (CONFIG_UBXLIB_TEST)
endif()
endif()

target_compile_options(ubxlib PRIVATE -Wno-format-truncation)

if (CONFIG_MINIMAL_LIBC)
target_sources(app PRIVATE
target_sources(ubxlib PRIVATE
${UBXLIB_BASE}/port/clib/u_port_clib_isblank.c
${UBXLIB_BASE}/port/clib/u_port_clib_mktime.c
${UBXLIB_BASE}/port/clib/u_port_setjmp.S
Expand All @@ -145,15 +152,15 @@ if (CONFIG_MINIMAL_LIBC)
endif()

if (CONFIG_UBXLIB_EDM_STREAM_DEBUG)
target_compile_definitions(app PRIVATE U_CFG_SHORT_RANGE_EDM_STREAM_DEBUG)
target_compile_definitions(ubxlib PRIVATE U_CFG_SHORT_RANGE_EDM_STREAM_DEBUG)
endif()

if (CONFIG_UBXLIB_EDM_STREAM_DEBUG_COLOR)
target_compile_definitions(app PRIVATE U_CFG_SHORT_RANGE_EDM_STREAM_DEBUG_COLOR)
target_compile_definitions(ubxlib PRIVATE U_CFG_SHORT_RANGE_EDM_STREAM_DEBUG_COLOR)
endif()

if (CONFIG_UBXLIB_EDM_STREAM_DEBUG_DUMP_DATA)
target_compile_definitions(app PRIVATE U_CFG_SHORT_RANGE_EDM_STREAM_DEBUG_DUMP_DATA)
target_compile_definitions(ubxlib PRIVATE U_CFG_SHORT_RANGE_EDM_STREAM_DEBUG_DUMP_DATA)
endif()


Expand Down

0 comments on commit adc3232

Please sign in to comment.