From d7dd0fa821054dd504984596136d47f32551ee20 Mon Sep 17 00:00:00 2001 From: Chris Burr Date: Mon, 7 Dec 2020 08:33:39 +0100 Subject: [PATCH] Support cross-compilation --- cmake/XRootDSystemCheck.cmake | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/cmake/XRootDSystemCheck.cmake b/cmake/XRootDSystemCheck.cmake index 800366c1334..23f8f269321 100644 --- a/cmake/XRootDSystemCheck.cmake +++ b/cmake/XRootDSystemCheck.cmake @@ -100,7 +100,11 @@ compiler_define_if_found( HAVE_ET_COM_ERR_H HAVE_ET_COM_ERR_H ) #------------------------------------------------------------------------------- # Check for the atomics #------------------------------------------------------------------------------- -check_cxx_source_runs( +if (CMAKE_CROSSCOMPILING) + message(WARNING "Cannot detect atomics support when cross-compiling, assuming atmoics are available") + set(HAVE_ATOMICS ON) +else() + check_cxx_source_runs( " int main() { @@ -120,7 +124,9 @@ check_cxx_source_runs( return 0; } " -HAVE_ATOMICS ) + HAVE_ATOMICS ) +endif() + option(EnableAtomicsIfPresent "EnableAtomicsIfPresent" ON) if ( EnableAtomicsIfPresent ) compiler_define_if_found( HAVE_ATOMICS HAVE_ATOMICS )