Skip to content

Commit

Permalink
[meshcop] do not allow OpenThread vendor in production build
Browse files Browse the repository at this point in the history
  • Loading branch information
bukepo committed Feb 12, 2025
1 parent 6c04545 commit 5e83900
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
13 changes: 11 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,17 @@ add_compile_options(-Wall -Wextra -Werror -Wfatal-errors -Wuninitialized -Wno-mi
add_library(otbr-config INTERFACE)

set(OTBR_INFRA_IF_NAME "wlan0" CACHE STRING "The infrastructure interface name")
set(OTBR_VENDOR_NAME "OpenThread" CACHE STRING "The vendor name")
set(OTBR_PRODUCT_NAME "BorderRouter" CACHE STRING "The product name")
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
set(OTBR_VENDOR_NAME "OpenThread" CACHE STRING "The vendor name")
set(OTBR_PRODUCT_NAME "BorderRouter" CACHE STRING "The product name")
else()
if(NOT DEFINED OTBR_VENDOR_NAME OR OTBR_VENDOR_NAME STREQUAL "OpenThread")
message(FATAL_ERROR "The vendor name is not defined")
endif()
if(NOT DEFINED OTBR_PRODUCT_NAME)
message(FATAL_ERROR "The product name is not defined")
endif()
endif()
set(OTBR_NAME "${OTBR_VENDOR_NAME}_${OTBR_PRODUCT_NAME}" CACHE STRING "The package name")
set(OTBR_MESHCOP_SERVICE_INSTANCE_NAME "${OTBR_VENDOR_NAME} ${OTBR_PRODUCT_NAME}" CACHE STRING "The OTBR MeshCoP service instance name")
set(OTBR_MDNS "avahi" CACHE STRING "mDNS publisher provider")
Expand Down
1 change: 1 addition & 0 deletions script/_otbr
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ otbr_install()

otbr_options=(
"-DBUILD_TESTING=OFF"
"-DMAKE_BUILD_TYPE=Debug"
"-DCMAKE_INSTALL_PREFIX=/usr"
"-DOTBR_DBUS=ON"
"-DOTBR_DNSSD_DISCOVERY_PROXY=ON"
Expand Down
4 changes: 2 additions & 2 deletions src/border_agent/border_agent.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@
#include "trel_dnssd/trel_dnssd.hpp"

#ifndef OTBR_VENDOR_NAME
#define OTBR_VENDOR_NAME "OpenThread"
#error "Vendor name is not defined."
#endif

#ifndef OTBR_PRODUCT_NAME
#define OTBR_PRODUCT_NAME "BorderRouter"
#error "Product name is not defined."
#endif

#ifndef OTBR_MESHCOP_SERVICE_INSTANCE_NAME
Expand Down

0 comments on commit 5e83900

Please sign in to comment.