From 5fa5c8b5e3137f6da1d70fd2df06b9d34564a88a Mon Sep 17 00:00:00 2001 From: Michael Spang Date: Mon, 13 Jul 2020 09:36:00 -0400 Subject: [PATCH] Add default build with linux device layer (#1568) * Add default build with linux device layer * Rename linux_embedded to linux_x64_gcc_embedded for consistency --- BUILD.gn | 24 ++++++++++++++++++++---- config/linux/toolchain/BUILD.gn | 26 ++++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 4 deletions(-) create mode 100644 config/linux/toolchain/BUILD.gn diff --git a/BUILD.gn b/BUILD.gn index 534a0b7cffa267..51964f737f22f7 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -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 @@ -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") { @@ -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" ] } @@ -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" ] + } } } } diff --git a/config/linux/toolchain/BUILD.gn b/config/linux/toolchain/BUILD.gn new file mode 100644 index 00000000000000..c77a89f01e66e9 --- /dev/null +++ b/config/linux/toolchain/BUILD.gn @@ -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") + } +}