Skip to content

Commit

Permalink
fix #74; list possible bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
TorstenRobitzki committed Apr 5, 2022
1 parent dcf9b53 commit 5265372
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@ project(lib_bluetoe CXX)

option(BLUETOE_BUILD_UNIT_TESTS "If true, unit test targets are added are build.")

# Libray required by everything in Bluetoe. If there is need to add build options,
# add them on bluetoe::iface.
add_library(bluetoe_iface INTERFACE)
target_compile_features(bluetoe_iface INTERFACE cxx_std_11)
add_library(bluetoe::iface ALIAS bluetoe_iface)
target_compile_features(bluetoe_iface INTERFACE cxx_std_11)
target_include_directories(bluetoe_iface INTERFACE ${CMAKE_CURRENT_SOURCE_DIR})

# Link Layer implementation based on radio hardware
Expand Down
10 changes: 9 additions & 1 deletion examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,13 @@ if (NOT CMAKE_CROSSCOMPILING)
message(FATAL_ERROR " examples can only be cross compiled to arm cortex-m, missing -Dtoolchain_file on cmake invocation?")
endif()

set(AVAILABLE_BINDINGS nrf51 nrf52)

set(BINDING nrf52 CACHE STRING "Microcontroller target to build for")
set_property(CACHE BINDING PROPERTY STRINGS ${AVAILABLE_BINDINGS})

if (NOT BINDING)
message(FATAL_ERROR " A binding must be defined. Use -DBINDING=nrf51. Current available bindings are nrf51, nrf52")
message(FATAL_ERROR " A binding must be defined. Use -DBINDING=nrf51. Current available bindings are ${AVAILABLE_BINDINGS}")
endif()

# include hardware specific compile options and definitions that must be apllied to the whole project
Expand Down Expand Up @@ -50,6 +55,9 @@ add_subdirectory(assert)
# bluetoe library
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/.. ${CMAKE_CURRENT_BINARY_DIR}/bluetoe)

# Additional settings for the Bluetoe library itself:
target_link_libraries(bluetoe_iface INTERFACE assert::arm)

function(add_bluetoe_example target_name)
add_executable(${target_name} ${target_name}.cpp runtime.cpp)
set_target_properties(${target_name}
Expand Down

0 comments on commit 5265372

Please sign in to comment.