Skip to content

Commit 31b825d

Browse files
committedJun 16, 2017
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 llvm-svn: 305593
1 parent d135e8c commit 31b825d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎compiler-rt/CMakeLists.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@
77
# An important constraint of the build is that it only produces libraries
88
# based on the ability of the host toolchain to target various platforms.
99

10+
cmake_minimum_required(VERSION 3.4.3)
11+
1012
# Check if compiler-rt is built as a standalone project.
1113
if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR OR COMPILER_RT_STANDALONE_BUILD)
1214
project(CompilerRT C CXX ASM)
1315
set(COMPILER_RT_STANDALONE_BUILD TRUE)
1416
endif()
1517

16-
cmake_minimum_required(VERSION 3.4.3)
17-
1818
# Add path for custom compiler-rt modules.
1919
list(INSERT CMAKE_MODULE_PATH 0
2020
"${CMAKE_CURRENT_SOURCE_DIR}/cmake"

0 commit comments

Comments
 (0)
Please sign in to comment.