Lines Matching +full:ninja +full:- +full:build
31 # This script calls cmake and ninja to compile OpenThread for the given platform.
33 # Compile with default build options:
35 # script/cmake-build ${platform}
37 # Compile with the specified build option enabled:
39 # script/cmake-build ${platform} -D${option}=ON
41 # Compile with the specified build option disabled that already enabled by default:
43 # script/cmake-build ${platform} -D${option}=OFF
45 # Compile with the specified ninja build target:
47 # OT_CMAKE_NINJA_TARGET="ot-cli-ftd" script/cmake-build ${platform}
48 # OT_CMAKE_NINJA_TARGET="ot-cli-ftd ot-cli-mtd" script/cmake-build ${platform}
50 # Compile with the specified build directory:
52 # OT_CMAKE_BUILD_DIR="./build/temp" script/cmake-build ${platform}
56 # script/cmake-build simulation
58 # script/cmake-build simulation -DOT_FULL_LOGS=ON -DOT_CHANNEL_MANAGER=OFF
60 … OT_CMAKE_NINJA_TARGET="ot-cli-mtd" OT_CMAKE_BUILD_DIR="./build/temp" script/cmake-build simul…
63 set -euxo pipefail
65 OT_CMAKE_NINJA_TARGET=${OT_CMAKE_NINJA_TARGET-}
70 OT_PLATFORMS=(simulation posix android-ndk)
74 "-DOT_ANYCAST_LOCATOR=ON"
75 "-DOT_BLE_TCAT=ON"
76 "-DOT_BORDER_AGENT=ON"
77 "-DOT_BORDER_AGENT_EPSKC=ON"
78 "-DOT_BORDER_AGENT_ID=ON"
79 "-DOT_BORDER_ROUTER=ON"
80 "-DOT_CHANNEL_MANAGER=ON"
81 "-DOT_CHANNEL_MONITOR=ON"
82 "-DOT_COAP=ON"
83 "-DOT_COAPS=ON"
84 "-DOT_COAP_BLOCK=ON"
85 "-DOT_COAP_OBSERVE=ON"
86 "-DOT_COMMISSIONER=ON"
87 "-DOT_COMPILE_WARNING_AS_ERROR=ON"
88 "-DOT_COVERAGE=ON"
89 "-DOT_DATASET_UPDATER=ON"
90 "-DOT_DHCP6_CLIENT=ON"
91 "-DOT_DHCP6_SERVER=ON"
92 "-DOT_DIAGNOSTIC=ON"
93 "-DOT_DNSSD_SERVER=ON"
94 "-DOT_DNS_CLIENT=ON"
95 "-DOT_ECDSA=ON"
96 "-DOT_HISTORY_TRACKER=ON"
97 "-DOT_IP6_FRAGM=ON"
98 "-DOT_JAM_DETECTION=ON"
99 "-DOT_JOINER=ON"
100 "-DOT_LOG_LEVEL_DYNAMIC=ON"
101 "-DOT_MAC_FILTER=ON"
102 "-DOT_NEIGHBOR_DISCOVERY_AGENT=ON"
103 "-DOT_NETDATA_PUBLISHER=ON"
104 "-DOT_NETDIAG_CLIENT=ON"
105 "-DOT_PING_SENDER=ON"
106 "-DOT_RCP_RESTORATION_MAX_COUNT=2"
107 "-DOT_RCP_TX_WAIT_TIME_SECS=5"
108 "-DOT_REFERENCE_DEVICE=ON"
109 "-DOT_SERVICE=ON"
110 "-DOT_SNTP_CLIENT=ON"
111 "-DOT_SRP_CLIENT=ON"
112 "-DOT_SRP_SERVER=ON"
113 "-DOT_UPTIME=ON"
123 build() function
126 local builddir="${OT_CMAKE_BUILD_DIR:-build/${platform}}"
129 mkdir -p "${builddir}"
132 …cmake -GNinja -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DOT_COMPILE_WARNING_AS_ERROR=ON "$@" "${OT_SRCDI…
133 if [[ -z ${OT_CMAKE_NINJA_TARGET// /} ]]; then
134 ninja
136 IFS=' ' read -r -a OT_CMAKE_NINJA_TARGET <<<"${OT_CMAKE_NINJA_TARGET}"
137 ninja "${OT_CMAKE_NINJA_TARGET[@]}"
152 echo "${OT_PLATFORMS[@]}" | grep -wq "${platform}" || die "${platform}"
157 "-DOT_SLAAC=ON"
161 android-ndk)
162 if [ -z "${NDK-}" ]; then
168 NDK=/opt/android-ndk-r25c ./script/cmake-build-android
176 NDK_CMAKE_TOOLCHAIN_FILE="${NDK?}/build/cmake/android.toolchain.cmake"
177 if [ ! -f "${NDK_CMAKE_TOOLCHAIN_FILE}" ]; then
180 - NDK=${NDK}
181 - NDK_CMAKE_TOOLCHAIN_FILE=${NDK_CMAKE_TOOLCHAIN_FILE}
187 "-DOT_LOG_OUTPUT=PLATFORM_DEFINED"
190 "-DOT_ANDROID_NDK=1"
191 "-DCMAKE_TOOLCHAIN_FILE=${NDK?}/build/cmake/android.toolchain.cmake"
193 # Android API needs to be >= android-24 for `getifsaddrs()`
194 "-DANDROID_PLATFORM=android-24"
196 # Store thread settings in the CWD when executing ot-cli or ot-daemon
197 '-DOT_POSIX_SETTINGS_PATH="./thread"'
204 …if [[ ${OT_CMAKE_NINJA_TARGET[*]} =~ "ot-daemon" ]] || [[ ${OT_CMAKE_NINJA_TARGET[*]} =~ "ot-ctl" …
205 local_options+=("-DOT_DAEMON=ON")
206 elif [[ ${OT_CMAKE_NINJA_TARGET[*]} =~ "ot-cli" ]]; then
207 local_options+=("-DOT_APP_CLI=ON")
215 "-DOT_TCP=OFF"
216 "-DOT_LOG_OUTPUT=PLATFORM_DEFINED"
217 "-DOT_POSIX_MAX_POWER_TABLE=ON"
223 "-DOT_LINK_RAW=ON"
224 "-DOT_DNS_DSO=ON"
225 "-DOT_DNS_CLIENT_OVER_TCP=ON"
226 "-DOT_UDP_FORWARD=ON"
231 options+=("-DCMAKE_TOOLCHAIN_FILE=examples/platforms/${platform}/arm-none-eabi.cmake")
236 "-DOT_PLATFORM=${platform}"
239 build "${platform}" "${options[@]}"