提交 44573323 编写于 作者: S storypku 提交者: Liu Jiaming

Build: set use_esd_can to False for arm64

上级 2ddc587d
......@@ -26,7 +26,7 @@ function check_architecture_support() {
function check_platform_support() {
local platform="$(uname -s)"
if [ "$platform" != "Linux" ]; then
if [[ "${platform}" != "Linux" ]]; then
error "Unsupported platform: ${platform}."
error "${TAB}Apollo is expected to run on Linux systems (E.g., Debian/Ubuntu)."
exit 1
......@@ -45,8 +45,9 @@ function check_minimal_memory_requirement() {
function determine_esdcan_use() {
local esdcan_dir="${APOLLO_ROOT_DIR}/third_party/can_card_library/esd_can"
local use_esd=false
if [ -f "${esdcan_dir}/include/ntcan.h" ] &&
[ -f "${esdcan_dir}/lib/libntcan.so.4" ]; then
if [[ "${ARCH}" == "x86_64" ]] &&
[[ -f "${esdcan_dir}/include/ntcan.h" ]] &&
[[ -f "${esdcan_dir}/lib/libntcan.so.4" ]]; then
use_esd=true
fi
USE_ESD_CAN="${use_esd}"
......@@ -160,7 +161,8 @@ function main() {
local coverage_sh="${APOLLO_ROOT_DIR}/scripts/apollo_coverage.sh"
local ci_sh="${APOLLO_ROOT_DIR}/scripts/apollo_ci.sh"
local cmd="$1"; shift
local cmd="$1"
shift
case "${cmd}" in
config)
env ${APOLLO_ENV} bash "${APOLLO_ROOT_DIR}/scripts/apollo_config.sh" "$@"
......
load("@rules_cc//cc:defs.bzl", "cc_library", "cc_test")
load("//tools/platform:build_defs.bzl", "if_esd_can")
load("//tools:cpplint.bzl", "cpplint")
package(default_visibility = ["//visibility:public"])
cc_library(
name = "esd_can_client",
srcs = ["esd_can_client.cc"],
hdrs = ["esd_can_client.h"],
deps = [
srcs = if_esd_can(["esd_can_client.cc"]),
hdrs = if_esd_can(["esd_can_client.h"]),
deps = if_esd_can([
"//modules/common/proto:error_code_cc_proto",
"//modules/drivers/canbus:sensor_gflags",
"//modules/drivers/canbus/can_client",
"//third_party/can_card_library/esd_can",
],
]),
)
cc_test(
name = "esd_can_client_test",
size = "small",
srcs = ["esd_can_client_test.cc"],
deps = [
srcs = if_esd_can(["esd_can_client_test.cc"]),
deps = if_esd_can([
":esd_can_client",
"//cyber",
"//modules/drivers/canbus/can_client/esd:esd_can_client",
"//modules/drivers/canbus/common:canbus_common",
]) + [
"@com_google_googletest//:gtest_main",
],
)
......
load("@rules_cc//cc:defs.bzl", "cc_library")
load("//tools/platform:build_defs.bzl", "if_esd_can")
package(default_visibility = ["//visibility:public"])
licenses(["notice"])
cc_library(
name = "esd_can",
srcs = [
"lib/libntcan.so.4",
],
hdrs = [
"include/ntcan.h",
],
srcs = if_esd_can(["lib/libntcan.so.4"]),
hdrs = if_esd_can(["include/ntcan.h"]),
include_prefix = "esd_can",
)
......@@ -32,3 +32,9 @@ def if_aarch64_mode(if_true, if_false = []):
"//tools/platform:aarch64_mode": if_true,
"//conditions:default": if_false,
})
def if_esd_can(if_true, if_false = []):
return select({
"//tools/platform:use_esd_can": if_true,
"//conditions:default": if_false,
})
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册