From 998e55806bbf74c25039debb1a87d9256dbd2edf Mon Sep 17 00:00:00 2001 From: Yi Huang Date: Fri, 15 Sep 2023 14:54:27 -0700 Subject: [PATCH] Set default toolchain file only for OneBranch/container builds (#3855) --- scripts/build.ps1 | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/build.ps1 b/scripts/build.ps1 index 1ab1ca786d..cdbea928b3 100644 --- a/scripts/build.ps1 +++ b/scripts/build.ps1 @@ -388,18 +388,18 @@ function CMake-Generate { if ($HostArch -ne $Arch) { if ($OneBranch) { $Arguments += " -DONEBRANCH=1" + if ($ToolchainFile -eq "") { + switch ($Arch) { + "arm" { $ToolchainFile = "cmake/toolchains/arm-linux.cmake" } + "arm64" { $ToolchainFile = "cmake/toolchains/aarch64-linux.cmake" } + } + } } $Arguments += " -DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER -DCMAKE_CROSSCOMPILING=1 -DCMAKE_SYSROOT=$SysRoot" switch ($Arch) { "arm64" { $Arguments += " -DCMAKE_CXX_COMPILER_TARGET=aarch64-linux-gnu -DCMAKE_C_COMPILER_TARGET=aarch64-linux-gnu -DCMAKE_TARGET_ARCHITECTURE=arm64" } "arm" { $Arguments += " -DCMAKE_CXX_COMPILER_TARGET=arm-linux-gnueabihf -DCMAKE_C_COMPILER_TARGET=arm-linux-gnueabihf -DCMAKE_TARGET_ARCHITECTURE=arm" } } - if ($ToolchainFile -eq "") { - switch ($Arch) { - "arm" { $ToolchainFile = "cmake/toolchains/arm-linux.cmake" } - "arm64" { $ToolchainFile = "cmake/toolchains/aarch64-linux.cmake" } - } - } } } if ($ToolchainFile -ne "") {