From e5653be62a8019a1e02b931be42536344aeacd0e Mon Sep 17 00:00:00 2001 From: Nico Weber Date: Wed, 16 Jan 2019 20:36:27 +0000 Subject: [PATCH] compiler-rt tests: Unbreak cmake with LLVM_ENABLE_PIC=OFF on mac The LTO target doesn't exist with LLVM_ENABLE_PIC turned off. Differential Revision: https://reviews.llvm.org/D56800 llvm-svn: 351373 --- compiler-rt/test/cfi/CMakeLists.txt | 20 +++++++++++--------- compiler-rt/test/safestack/CMakeLists.txt | 20 +++++++++++--------- 2 files changed, 22 insertions(+), 18 deletions(-) diff --git a/compiler-rt/test/cfi/CMakeLists.txt b/compiler-rt/test/cfi/CMakeLists.txt index 4dbbf1759fcc..d99213632d00 100644 --- a/compiler-rt/test/cfi/CMakeLists.txt +++ b/compiler-rt/test/cfi/CMakeLists.txt @@ -74,15 +74,17 @@ if(NOT COMPILER_RT_STANDALONE_BUILD) opt sanstats ) - if(LLVM_ENABLE_PIC AND LLVM_BINUTILS_INCDIR) - list(APPEND CFI_TEST_DEPS - LLVMgold - ) - endif() - if(APPLE) - list(APPEND CFI_TEST_DEPS - LTO - ) + if(LLVM_ENABLE_PIC) + if(LLVM_BINUTILS_INCDIR) + list(APPEND CFI_TEST_DEPS + LLVMgold + ) + endif() + if(APPLE) + list(APPEND CFI_TEST_DEPS + LTO + ) + endif() endif() if(NOT APPLE AND COMPILER_RT_HAS_LLD) list(APPEND CFI_TEST_DEPS diff --git a/compiler-rt/test/safestack/CMakeLists.txt b/compiler-rt/test/safestack/CMakeLists.txt index c56e81a3ce21..e30a676d74a1 100644 --- a/compiler-rt/test/safestack/CMakeLists.txt +++ b/compiler-rt/test/safestack/CMakeLists.txt @@ -6,15 +6,17 @@ if(NOT COMPILER_RT_STANDALONE_BUILD) list(APPEND SAFESTACK_TEST_DEPS safestack) # Some tests require LTO, so add a dependency on the relevant LTO plugin. - if(LLVM_ENABLE_PIC AND LLVM_BINUTILS_INCDIR) - list(APPEND SAFESTACK_TEST_DEPS - LLVMgold - ) - endif() - if(APPLE) - list(APPEND SAFESTACK_TEST_DEPS - LTO - ) + if(LLVM_ENABLE_PIC) + if(LLVM_BINUTILS_INCDIR) + list(APPEND SAFESTACK_TEST_DEPS + LLVMgold + ) + endif() + if(APPLE) + list(APPEND SAFESTACK_TEST_DEPS + LTO + ) + endif() endif() endif()