Skip to content

Commit

Permalink
Add default build with linux device layer (project-chip#1568)
Browse files Browse the repository at this point in the history
* Add default build with linux device layer

* Rename linux_embedded to linux_x64_gcc_embedded for consistency
  • Loading branch information
mspang authored and kedars committed Jul 19, 2020
1 parent 17ec1e9 commit bb6511b
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 4 deletions.
24 changes: 20 additions & 4 deletions BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,11 @@ if (current_toolchain != "${dir_pw_toolchain}/dummy:dummy") {
# Enable building chip with gcc.
enable_host_gcc_build = enable_default_builds

# Build building chip with gcc & mbedtls.
enable_host_gcc_mbdtls_build = enable_default_builds
# Enable building chip with gcc & mbedtls.
enable_host_gcc_mbedtls_build = enable_default_builds

# Enable building chip for linux embedded.
enable_linux_embedded_build = enable_default_builds && host_os == "linux"

# Build the chip-tool example.
enable_standalone_chip_tool_build = enable_default_builds
Expand All @@ -134,6 +137,13 @@ if (current_toolchain != "${dir_pw_toolchain}/dummy:dummy") {
toolchain = "${chip_root}/config/mbedtls/toolchain:${host_os}_${host_cpu}_gcc_mbedtls"
}

if (host_os == "linux") {
chip_build("linux_embedded") {
toolchain =
"${chip_root}/config/linux/toolchain:linux_${host_cpu}_gcc_embedded"
}
}

standalone_toolchain = "${chip_root}/config/standalone/toolchain:standalone"

group("standalone_chip_tool") {
Expand Down Expand Up @@ -164,9 +174,12 @@ if (current_toolchain != "${dir_pw_toolchain}/dummy:dummy") {
if (enable_host_gcc_build) {
deps += [ ":all_host_gcc" ]
}
if (enable_host_gcc_mbdtls_build) {
if (enable_host_gcc_mbedtls_build) {
deps += [ ":all_host_gcc_mbedtls" ]
}
if (enable_linux_embedded_build) {
deps += [ ":all_linux_embedded" ]
}
if (enable_standalone_chip_tool_build) {
deps += [ ":standalone_chip_tool" ]
}
Expand All @@ -190,9 +203,12 @@ if (current_toolchain != "${dir_pw_toolchain}/dummy:dummy") {
if (enable_host_gcc_build) {
deps += [ ":check_host_gcc" ]
}
if (enable_host_gcc_mbdtls_build) {
if (enable_host_gcc_mbedtls_build) {
deps += [ ":check_host_gcc_mbedtls" ]
}
if (enable_linux_embedded_build) {
deps += [ ":check_linux_embedded" ]
}
}
}
}
26 changes: 26 additions & 0 deletions config/linux/toolchain/BUILD.gn
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Copyright (c) 2020 Project CHIP Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import("//build_overrides/chip.gni")

import("//build/toolchain/gcc_toolchain.gni")

gcc_toolchain("linux_${host_cpu}_gcc_embedded") {
toolchain_args = {
current_os = "linux"
current_cpu = host_cpu
is_clang = false
import("${chip_root}/src/platform/Linux/args.gni")
}
}

0 comments on commit bb6511b

Please sign in to comment.