summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorBob Haarman <llvm@inglorion.net>2017-03-21 18:25:35 +0000
committerBob Haarman <llvm@inglorion.net>2017-03-21 18:25:35 +0000
commitba802a4235ecdadc45278718b861d54efc07c626 (patch)
treeb4e3558f473573230b94d276b4f2db467bbf0205 /CMakeLists.txt
parent7ea40255820c1b7fbc45e05e99351c9c667e6624 (diff)
[compiler-rt] respect CMAKE_EXE_LINKER_FLAGS in compiler and library tests
Summary: check_cxx_compiler_flag and check_library_exists could fail because they ignored CMAKE_EXE_LINKER_FLAGS and therefore would always fail to produce executables. Cmake policy CMP0056 fixes this, but was explicitly set to OLD in our CMakeLists because it caused problems with test_target_arch. This change sets the policy to NEW to fix the problem with the compiler and library tests, and temporarily clears CMAKE_EXE_LINKER_FLAGS inside test_target_arch to emulate the old behavior there. This allows, for example, LTO builds that require lld to succeed. Reviewers: davidxl, beanz Reviewed By: beanz Subscribers: fjricci, dberris, mgorny, mehdi_amini, tejohnson, rnk, llvm-commits Differential Revision: https://reviews.llvm.org/D31098 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@298413 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt10
1 files changed, 0 insertions, 10 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index cbde83113..9714340dd 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -14,16 +14,6 @@ if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR OR COMPILER_RT_STANDALONE
endif()
cmake_minimum_required(VERSION 3.4.3)
-# FIXME:
-# The OLD behavior (pre 3.2) for this policy is to not set the value of the
-# CMAKE_EXE_LINKER_FLAGS variable in the generated test project. The NEW behavior
-# for this policy is to set the value of the CMAKE_EXE_LINKER_FLAGS variable
-# in the test project to the same as it is in the calling project. The new
-# behavior cause the compiler_rt test to fail during try_compile: see
-# projects/compiler-rt/cmake/Modules/CompilerRTUtils.cmake:121 such that
-# CAN_TARGET_${arch} is not set properly. This results in COMPILER_RT_SUPPORTED_ARCH
-# not being updated properly leading to poblems.
-cmake_policy(SET CMP0056 OLD)
# Add path for custom compiler-rt modules.
list(INSERT CMAKE_MODULE_PATH 0