summaryrefslogtreecommitdiff
path: root/cmake/Modules/CompilerRTUtils.cmake
diff options
context:
space:
mode:
authorDaniel Sanders <daniel.sanders@imgtec.com>2016-07-22 10:15:09 +0000
committerDaniel Sanders <daniel.sanders@imgtec.com>2016-07-22 10:15:09 +0000
commitcdd25966727d50c17015d077c5b931b1f32f9d07 (patch)
tree0d2843a2e3bfe11200b1444c495ea43b933925c1 /cmake/Modules/CompilerRTUtils.cmake
parenta5817152a50137318d7c4340f4c7a208bc5ead8e (diff)
[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. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@276402 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'cmake/Modules/CompilerRTUtils.cmake')
-rw-r--r--cmake/Modules/CompilerRTUtils.cmake22
1 files changed, 12 insertions, 10 deletions
diff --git a/cmake/Modules/CompilerRTUtils.cmake b/cmake/Modules/CompilerRTUtils.cmake
index 5987cf510..2ced895b6 100644
--- a/cmake/Modules/CompilerRTUtils.cmake
+++ b/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})