From 9ff3fc24d663c1e1d2857b52cc30bedd817f3695 Mon Sep 17 00:00:00 2001 From: Adeel <3840695+am11@users.noreply.github.com> Date: Fri, 18 Nov 2022 05:24:06 +0200 Subject: [PATCH] Fix freebsd cross build with cmake 3.25 --- eng/common/cross/toolchain.cmake | 7 +++++++ eng/pipelines/common/templates/pipeline-with-resources.yml | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/eng/common/cross/toolchain.cmake b/eng/common/cross/toolchain.cmake index 561576be97c262..964610524760a3 100644 --- a/eng/common/cross/toolchain.cmake +++ b/eng/common/cross/toolchain.cmake @@ -1,5 +1,12 @@ set(CROSS_ROOTFS $ENV{ROOTFS_DIR}) +# reset platform variables (e.g. cmake 3.25 sets LINUX=1) +unset(LINUX) +unset(FREEBSD) +unset(ILLUMOS) +unset(ANDROID) +unset(TIZEN) + set(TARGET_ARCH_NAME $ENV{TARGET_BUILD_ARCH}) if(EXISTS ${CROSS_ROOTFS}/bin/freebsd-version) set(CMAKE_SYSTEM_NAME FreeBSD) diff --git a/eng/pipelines/common/templates/pipeline-with-resources.yml b/eng/pipelines/common/templates/pipeline-with-resources.yml index f799590fa4371d..6371f176d872d0 100644 --- a/eng/pipelines/common/templates/pipeline-with-resources.yml +++ b/eng/pipelines/common/templates/pipeline-with-resources.yml @@ -61,7 +61,7 @@ resources: image: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-18.04-webassembly - container: FreeBSD_x64 - image: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-18.04-cross-freebsd-12-20221026180137-3fc5553 + image: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-18.04-cross-freebsd-12 env: ROOTFS_DIR: /crossrootfs/x64