Skip to content

Commit 32ca2c0

Browse files
committed
Set CMake minimum required version only once
According to the docs[1], <cmake_minimum_required> should be called at the beginning of the top-level CMakeLists.txt (even before calling the <project> command) to set the version and the policy settings before invoking other commands whose behavior they may affect. All other calls (especially, setting the same version) are definitely excess. Hence, the patch drops <cmake_minimum_required> calls from all CMakeLists.txt except the root one. [1]: https://cmake.org/cmake/help/latest/command/cmake_minimum_required.html Signed-off-by: Igor Munkin <imun@cpan.org>
1 parent 20d8e7b commit 32ca2c0

File tree

5 files changed

+0
-8
lines changed

5 files changed

+0
-8
lines changed

3rdparty/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
# Copyright (C) 2020-2025 LuaVela Authors. See Copyright Notice in COPYRIGHT
33
# Copyright (C) 2015-2020 IPONWEB Ltd. See Copyright Notice in COPYRIGHT
44

5-
cmake_minimum_required (VERSION 3.3.2 FATAL_ERROR)
6-
75
include(ExternalProject)
86

97
set(THIRD_PARTY_INCLUDE)

etc/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
# Copyright (C) 2020-2025 LuaVela Authors. See Copyright Notice in COPYRIGHT
33
# Copyright (C) 2015-2020 IPONWEB Ltd. See Copyright Notice in COPYRIGHT
44

5-
cmake_minimum_required (VERSION 3.3.2 FATAL_ERROR)
6-
75
set(UJIT_MAN_PAGE ${CMAKE_CURRENT_SOURCE_DIR}/ujit.1)
86
set(UJIT_COMPRESSED_MAN_PAGE ${CMAKE_CURRENT_BINARY_DIR}/ujit.1.gz)
97

src/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
# Copyright (C) 2020-2025 LuaVela Authors. See Copyright Notice in COPYRIGHT
33
# Copyright (C) 2015-2020 IPONWEB Ltd. See Copyright Notice in COPYRIGHT
44

5-
cmake_minimum_required (VERSION 3.3.2 FATAL_ERROR)
65
enable_language (ASM)
76

87
include_directories(${CMAKE_CURRENT_SOURCE_DIR}) # for sub-projects

tests/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
# Copyright (C) 2020-2025 LuaVela Authors. See Copyright Notice in COPYRIGHT
33
# Copyright (C) 2015-2020 IPONWEB Ltd. See Copyright Notice in COPYRIGHT
44

5-
cmake_minimum_required (VERSION 3.3.2 FATAL_ERROR)
6-
75
set(CMAKE_MODULE_PATH
86
${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake"
97
)

tools/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
# Copyright (C) 2020-2025 LuaVela Authors. See Copyright Notice in COPYRIGHT
33
# Copyright (C) 2015-2020 IPONWEB Ltd. See Copyright Notice in COPYRIGHT
44

5-
cmake_minimum_required (VERSION 3.3.2 FATAL_ERROR)
65
enable_language(C)
76

87
include(MakeSourceList)

0 commit comments

Comments
 (0)