Skip to content

Commit 5265372

Browse files
fix #74; list possible bindings
1 parent dcf9b53 commit 5265372

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,11 @@ project(lib_bluetoe CXX)
77

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

10+
# Libray required by everything in Bluetoe. If there is need to add build options,
11+
# add them on bluetoe::iface.
1012
add_library(bluetoe_iface INTERFACE)
11-
target_compile_features(bluetoe_iface INTERFACE cxx_std_11)
1213
add_library(bluetoe::iface ALIAS bluetoe_iface)
14+
target_compile_features(bluetoe_iface INTERFACE cxx_std_11)
1315
target_include_directories(bluetoe_iface INTERFACE ${CMAKE_CURRENT_SOURCE_DIR})
1416

1517
# Link Layer implementation based on radio hardware

examples/CMakeLists.txt

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,13 @@ if (NOT CMAKE_CROSSCOMPILING)
1010
message(FATAL_ERROR " examples can only be cross compiled to arm cortex-m, missing -Dtoolchain_file on cmake invocation?")
1111
endif()
1212

13+
set(AVAILABLE_BINDINGS nrf51 nrf52)
14+
15+
set(BINDING nrf52 CACHE STRING "Microcontroller target to build for")
16+
set_property(CACHE BINDING PROPERTY STRINGS ${AVAILABLE_BINDINGS})
17+
1318
if (NOT BINDING)
14-
message(FATAL_ERROR " A binding must be defined. Use -DBINDING=nrf51. Current available bindings are nrf51, nrf52")
19+
message(FATAL_ERROR " A binding must be defined. Use -DBINDING=nrf51. Current available bindings are ${AVAILABLE_BINDINGS}")
1520
endif()
1621

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

58+
# Additional settings for the Bluetoe library itself:
59+
target_link_libraries(bluetoe_iface INTERFACE assert::arm)
60+
5361
function(add_bluetoe_example target_name)
5462
add_executable(${target_name} ${target_name}.cpp runtime.cpp)
5563
set_target_properties(${target_name}

0 commit comments

Comments
 (0)