mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-03-29 22:20:37 +00:00
stm32-f4discovery-cc256x: create Ozone jdebug files
This commit is contained in:
parent
1a4df347bf
commit
2e62bff6d3
@ -76,15 +76,6 @@ file(GLOB GATT_FILES "../../src/*/gatt-service/*.gatt")
|
||||
# workaround: add lwip sources only to lwip_examples
|
||||
set (LWIP_EXAMPLES pan_lwip_http_server)
|
||||
|
||||
# Create Ozone .jdebug files
|
||||
function(CreateOzoneProject exampleName)
|
||||
set(INPUT_FILE "ozone.jdebug")
|
||||
set(OUTPUT_FILE ${CMAKE_CURRENT_BINARY_DIR}/${exampleName}.jdebug)
|
||||
file(READ ${INPUT_FILE} FILE_CONTENTS)
|
||||
string(REPLACE "EXAMPLE" ${exampleName} MODIFIED_CONTENTS ${FILE_CONTENTS})
|
||||
file(WRITE ${OUTPUT_FILE} "${MODIFIED_CONTENTS}")
|
||||
endfunction()
|
||||
|
||||
# Create targets
|
||||
foreach(EXAMPLE_FILE ${EXAMPLES_C})
|
||||
# Extract the base name of the file (e.g., a2dp_sink_demo.c -> a2dp_sink_demo)
|
||||
@ -107,16 +98,26 @@ foreach(EXAMPLE_FILE ${EXAMPLES_C})
|
||||
if ( "${EXAMPLES_GATT}" MATCHES ${EXAMPLE} )
|
||||
message("example ${EXAMPLE} -- with GATT DB")
|
||||
add_custom_command(
|
||||
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${EXAMPLE}.h
|
||||
DEPENDS ${BTSTACK_ROOT}/example/${EXAMPLE}.gatt ${GATT_FILES}
|
||||
COMMAND ${Python_EXECUTABLE}
|
||||
ARGS ${BTSTACK_ROOT}/tool/compile_gatt.py ${BTSTACK_ROOT}/example/${EXAMPLE}.gatt ${CMAKE_CURRENT_BINARY_DIR}/${EXAMPLE}.h
|
||||
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${EXAMPLE}.h
|
||||
DEPENDS ${BTSTACK_ROOT}/example/${EXAMPLE}.gatt ${GATT_FILES}
|
||||
COMMAND ${Python_EXECUTABLE}
|
||||
ARGS ${BTSTACK_ROOT}/tool/compile_gatt.py ${BTSTACK_ROOT}/example/${EXAMPLE}.gatt ${CMAKE_CURRENT_BINARY_DIR}/${EXAMPLE}.h
|
||||
)
|
||||
list(APPEND SOURCES_EXAMPLE ${CMAKE_CURRENT_BINARY_DIR}/${EXAMPLE}.h)
|
||||
else()
|
||||
message("example ${EXAMPLE}")
|
||||
endif()
|
||||
|
||||
# Create Ozone Project
|
||||
set(OZONE_PROJECT_FILE ${CMAKE_CURRENT_BINARY_DIR}/${EXAMPLE}.jdebug)
|
||||
add_custom_command(
|
||||
OUTPUT ${OZONE_PROJECT_FILE}
|
||||
DEPENDS ozone.jdebug ${CMAKE_SOURCE_DIR}/CMakelists.txt
|
||||
COMMAND ${Python_EXECUTABLE}
|
||||
ARGS ${BTSTACK_ROOT}/tool/replace_string.py ${CMAKE_SOURCE_DIR}/ozone.jdebug ${OZONE_PROJECT_FILE} "EXAMPLE" ${EXAMPLE}
|
||||
)
|
||||
list(APPEND SOURCES_EXAMPLE ${OZONE_PROJECT_FILE})
|
||||
|
||||
# Create an executable target for the example
|
||||
add_executable(${EXAMPLE} ${SOURCES_EXAMPLE} )
|
||||
|
||||
@ -150,7 +151,4 @@ foreach(EXAMPLE_FILE ${EXAMPLES_C})
|
||||
${SOURCES_EXAMPLE}
|
||||
)
|
||||
|
||||
# Create Ozone Project
|
||||
CreateOzoneProject(${EXAMPLE})
|
||||
|
||||
endforeach()
|
Loading…
x
Reference in New Issue
Block a user