Skip to content

Commit

Permalink
[build] remove default vendor name
Browse files Browse the repository at this point in the history
  • Loading branch information
bukepo committed Feb 20, 2025
1 parent e2f3c1f commit 9b2e601
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 5 deletions.
14 changes: 13 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,20 @@ 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")
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
set(OTBR_VENDOR_NAME "OpenThreadDebug" CACHE STRING "The vendor name")
else()
if(OTBR_VENDOR_NAME STREQUAL "OpenThreadDebug")
message(FATAL_ERROR "Invalid vendor name")
endif()
endif()
if(NOT OTBR_VENDOR_NAME)
message(FATAL_ERROR "Missing vendor name")
endif()
set(OTBR_PRODUCT_NAME "BorderRouter" CACHE STRING "The product name")
if(NOT OTBR_PRODUCT_NAME)
message(FATAL_ERROR "Missing product name")
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 etc/openwrt/openthread-br/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ CMAKE_OPTIONS+= \
-DOTBR_MDNS="avahi" \
-DOTBR_OPENWRT=ON \
-DOTBR_SRP_ADVERTISING_PROXY=ON \
-DOTBR_VENDOR_NAME="OpenWrt" \
-DOT_FIREWALL=ON \
-DOT_POSIX_SETTINGS_PATH=\"/etc/openthread\" \
-DOT_READLINE=OFF \
Expand Down
7 changes: 7 additions & 0 deletions script/_otbr
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,13 @@ otbr_install()
)
fi

if with RELEASE; then
otbr_options+=(
"-DCMAKE_BUILD_TYPE=MinSizeRel"
"-DOTBR_VENDOR_NAME=OpenThreadTest"
)
fi

if with NAT64 && [[ ${NAT64_SERVICE-} == "openthread" ]]; then
otbr_options+=(
"-DOTBR_NAT64=ON"
Expand Down
7 changes: 6 additions & 1 deletion script/cmake-build
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@
#
# OTBR_BUILD_DIR="./build/temp" script/cmake-build
#
# Compile a release build (vendor name is required):
#
# script/cmake-build -DOT_CMAKE_BUILD_TYPE=Release -DOTBR_VENDOR_NAME=YourOrganizationName
#
# Examples:
#
# script/cmake-build
Expand Down Expand Up @@ -75,7 +79,8 @@ main()
(
cd "${builddir}" || die "Failed to enter ${builddir}"

cmake -GNinja -DCMAKE_EXPORT_COMPILE_COMMANDS=ON "${OTBR_TOP_SRCDIR}" "$@"
cmake -GNinja -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-DCMAKE_BUILD_TYPE=Debug "${OTBR_TOP_SRCDIR}" "$@"

if [[ -n ${OTBR_TARGET[*]} ]]; then
ninja "${OTBR_TARGET[@]}"
Expand Down
2 changes: 2 additions & 0 deletions script/test
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ do_build()
"-DOTBR_UNSECURE_JOIN=ON"
"-DOTBR_TREL=ON"
"-DOTBR_LINK_METRICS_TELEMETRY=ON"
"-DOTBR_VENDOR_NAME=OpenThreadTest"
${otbr_options[@]+"${otbr_options[@]}"}
)

Expand Down Expand Up @@ -195,6 +196,7 @@ do_package()
"-DCMAKE_INSTALL_PREFIX=/usr"
"-DCMAKE_BUILD_TYPE=Release"
"-DOTBR_WEB=ON"
"-DOTBR_VENDOR_NAME=OpenThreadTest"
${otbr_options[@]+"${otbr_options[@]}"}
)

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 "Missing Vendor name"
#endif

#ifndef OTBR_PRODUCT_NAME
#define OTBR_PRODUCT_NAME "BorderRouter"
#error "Missing product name"
#endif

#ifndef OTBR_MESHCOP_SERVICE_INSTANCE_NAME
Expand Down
1 change: 1 addition & 0 deletions tests/scripts/check-scan-build
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ main()
-DOTBR_FEATURE_FLAGS=ON \
-DOTBR_TELEMETRY_DATA_API=ON \
-DOTBR_WEB=ON \
-DOTBR_VENDOR_NAME="OpenThreadTest" \
-DOTBR_REST=ON \
.. \
&& scan-build -o "${SCAN_TMPDIR}" -analyze-headers -v ninja)
Expand Down
2 changes: 1 addition & 1 deletion tests/scripts/meshcop
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ TUN_NAME=wpan0
readonly TUN_NAME

# The default meshcop service instance name
OT_SERVICE_INSTANCE='OpenThread\(\\032\| \)BorderRouter\(\\032\| \)#[0-9A-F][0-9A-F][0-9A-F][0-9A-F]'
OT_SERVICE_INSTANCE='OpenThreadTest\(\\032\| \)BorderRouter\(\\032\| \)#[0-9A-F][0-9A-F][0-9A-F][0-9A-F]'
readonly OT_SERVICE_INSTANCE

echo "ORIGIN_PWD: ${ORIGIN_PWD}"
Expand Down

0 comments on commit 9b2e601

Please sign in to comment.