From aea8b553e3b75601f02629d1433672fbdd72cd7e Mon Sep 17 00:00:00 2001 From: Daniel Sanders Date: Fri, 22 Jul 2016 10:15:09 +0000 Subject: [PATCH] [compiler-rt][cmake] Don't reset CAN_TARGET_${arch} on every cmake invocation. Allowing this variable to be cached makes it possible to repair the MIPS buildbots in lieu of either fixing the mips64 sanitizer issues or fixing the detection of mips64 support (which I think was changed by r268977 but didn't take effect on this buildbot until the last couple days) so that it returns to not being built on these buildbots. llvm-svn: 276402 --- .../cmake/Modules/CompilerRTUtils.cmake | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/compiler-rt/cmake/Modules/CompilerRTUtils.cmake b/compiler-rt/cmake/Modules/CompilerRTUtils.cmake index 5987cf51054b..2ced895b6127 100644 --- a/compiler-rt/cmake/Modules/CompilerRTUtils.cmake +++ b/compiler-rt/cmake/Modules/CompilerRTUtils.cmake @@ -113,16 +113,18 @@ macro(test_target_arch arch def) set(argstring "${argstring} ${arg}") endforeach() check_compile_definition("${def}" "${argstring}" HAS_${arch}_DEF) - if(NOT HAS_${arch}_DEF) - set(CAN_TARGET_${arch} FALSE) - elseif(TEST_COMPILE_ONLY) - try_compile_only(CAN_TARGET_${arch} ${TARGET_${arch}_CFLAGS}) - else() - set(argstring "${CMAKE_EXE_LINKER_FLAGS} ${argstring}") - try_compile(CAN_TARGET_${arch} ${CMAKE_BINARY_DIR} ${SIMPLE_SOURCE} - COMPILE_DEFINITIONS "${TARGET_${arch}_CFLAGS}" - OUTPUT_VARIABLE TARGET_${arch}_OUTPUT - CMAKE_FLAGS "-DCMAKE_EXE_LINKER_FLAGS:STRING=${argstring}") + if(NOT DEFINED CAN_TARGET_${arch}) + if(NOT HAS_${arch}_DEF) + set(CAN_TARGET_${arch} FALSE) + elseif(TEST_COMPILE_ONLY) + try_compile_only(CAN_TARGET_${arch} ${TARGET_${arch}_CFLAGS}) + else() + set(argstring "${CMAKE_EXE_LINKER_FLAGS} ${argstring}") + try_compile(CAN_TARGET_${arch} ${CMAKE_BINARY_DIR} ${SIMPLE_SOURCE} + COMPILE_DEFINITIONS "${TARGET_${arch}_CFLAGS}" + OUTPUT_VARIABLE TARGET_${arch}_OUTPUT + CMAKE_FLAGS "-DCMAKE_EXE_LINKER_FLAGS:STRING=${argstring}") + endif() endif() if(${CAN_TARGET_${arch}}) list(APPEND COMPILER_RT_SUPPORTED_ARCH ${arch})