summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShoaib Meenai <smeenai@fb.com>2017-11-02 20:33:36 +0000
committerShoaib Meenai <smeenai@fb.com>2017-11-02 20:33:36 +0000
commitc542c3e0ec8430835c3a777ceaa1e741d5d93eb6 (patch)
treefc53e5ba3c3ac121c9f27fe136368e2d5bf46eb8
parentf55435ab6136aa1af0f3291d3a842bde9ec03668 (diff)
downloadbcm5719-llvm-c542c3e0ec8430835c3a777ceaa1e741d5d93eb6.tar.gz
bcm5719-llvm-c542c3e0ec8430835c3a777ceaa1e741d5d93eb6.zip
[cmake] Remove policy conditionals
LLVM now requires a minimum of cmake 3.4.3, and all the policies currently being set are present in that cmake version, so the conditionals will always be true and are therefore unnecessary. The movation is that the conditionals can give the false impression that the policy settings are optional, whereas for example it's necessary to set CMP0056 in order for `check_linker_flags` to operate correctly after r316972. Inline the project version and language setting in the process. Differential Revision: https://reviews.llvm.org/D39442 llvm-svn: 317264
-rw-r--r--llvm/CMakeLists.txt40
1 files changed, 13 insertions, 27 deletions
diff --git a/llvm/CMakeLists.txt b/llvm/CMakeLists.txt
index 04565038311..e27562dc8b5 100644
--- a/llvm/CMakeLists.txt
+++ b/llvm/CMakeLists.txt
@@ -2,26 +2,20 @@
cmake_minimum_required(VERSION 3.4.3)
-if(POLICY CMP0022)
- cmake_policy(SET CMP0022 NEW) # automatic when 2.8.12 is required
-endif()
+cmake_policy(SET CMP0022 NEW)
-if (POLICY CMP0051)
- # CMake 3.1 and higher include generator expressions of the form
- # $<TARGETLIB:obj> in the SOURCES property. These need to be
- # stripped everywhere that access the SOURCES property, so we just
- # defer to the OLD behavior of not including generator expressions
- # in the output for now.
- cmake_policy(SET CMP0051 OLD)
-endif()
+cmake_policy(SET CMP0048 NEW)
-if(POLICY CMP0056)
- cmake_policy(SET CMP0056 NEW)
-endif()
+# CMake 3.1 and higher include generator expressions of the form
+# $<TARGETLIB:obj> in the SOURCES property. These need to be
+# stripped everywhere that access the SOURCES property, so we just
+# defer to the OLD behavior of not including generator expressions
+# in the output for now.
+cmake_policy(SET CMP0051 OLD)
-if(POLICY CMP0057)
- cmake_policy(SET CMP0057 NEW)
-endif()
+cmake_policy(SET CMP0056 NEW)
+
+cmake_policy(SET CMP0057 NEW)
if(NOT DEFINED LLVM_VERSION_MAJOR)
set(LLVM_VERSION_MAJOR 6)
@@ -36,13 +30,6 @@ if(NOT DEFINED LLVM_VERSION_SUFFIX)
set(LLVM_VERSION_SUFFIX svn)
endif()
-if (POLICY CMP0048)
- cmake_policy(SET CMP0048 NEW)
- set(cmake_3_0_PROJ_VERSION
- VERSION ${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}.${LLVM_VERSION_PATCH})
- set(cmake_3_0_LANGUAGES LANGUAGES)
-endif()
-
if (NOT PACKAGE_VERSION)
set(PACKAGE_VERSION
"${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}.${LLVM_VERSION_PATCH}${LLVM_VERSION_SUFFIX}")
@@ -56,9 +43,8 @@ if ((CMAKE_GENERATOR MATCHES "Visual Studio") AND (CMAKE_GENERATOR_TOOLSET STREQ
endif()
project(LLVM
- ${cmake_3_0_PROJ_VERSION}
- ${cmake_3_0_LANGUAGES}
- C CXX ASM)
+ VERSION ${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}.${LLVM_VERSION_PATCH}
+ LANGUAGES C CXX ASM)
if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message(STATUS "No build type selected, default to Debug")
OpenPOWER on IntegriCloud