[compiler-rt] r305593 - Call cmake_minimum_required at the top of CMakeLists.txt

Pirama Arumuga Nainar via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 16 14:14:46 PDT 2017


Author: pirama
Date: Fri Jun 16 16:14:45 2017
New Revision: 305593

URL: http://llvm.org/viewvc/llvm-project?rev=305593&view=rev
Log:
Call cmake_minimum_required at the top of CMakeLists.txt

Summary:
Since r298413, the NEW behavior of the CMake policy CMP0056 is followed.
However, it is only effective after the call to cmake_minimum_required.
This causes CMAKE_EXE_LINKER_FLAGS etc. to be unused when CMake tries to
check compilers for languages specified in the 'project' declaration.

Set cmake_minimum_required(VERSION) at the top of the file and ahead of
the project declaration.

Reviewers: beanz

Subscribers: mgorny, srhines, llvm-commits

Differential Revision: https://reviews.llvm.org/D34282

Modified:
    compiler-rt/trunk/CMakeLists.txt

Modified: compiler-rt/trunk/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/CMakeLists.txt?rev=305593&r1=305592&r2=305593&view=diff
==============================================================================
--- compiler-rt/trunk/CMakeLists.txt (original)
+++ compiler-rt/trunk/CMakeLists.txt Fri Jun 16 16:14:45 2017
@@ -7,14 +7,14 @@
 # An important constraint of the build is that it only produces libraries
 # based on the ability of the host toolchain to target various platforms.
 
+cmake_minimum_required(VERSION 3.4.3)
+
 # Check if compiler-rt is built as a standalone project.
 if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR OR COMPILER_RT_STANDALONE_BUILD)
   project(CompilerRT C CXX ASM)
   set(COMPILER_RT_STANDALONE_BUILD TRUE)
 endif()
 
-cmake_minimum_required(VERSION 3.4.3)
-
 # Add path for custom compiler-rt modules.
 list(INSERT CMAKE_MODULE_PATH 0
   "${CMAKE_CURRENT_SOURCE_DIR}/cmake"




More information about the llvm-commits mailing list