Skip to content

Commit 3c346df

Browse files
authored
feat: upgrade min cmake version to 3.12 (#90)
This change is prompted by the fact that cmake 4.0 now produces deprecation warnings on CMakeLists.txt files that have a min version below 3.5. Given the opportunity, I decided to bump up all the way to 3.12, which introduces a built-in equivalent to FindPython.cmake For reference, cmake 3.5 was released in 2016 and 3.12 was released in 2018.
1 parent 751b4ec commit 3c346df

File tree

3 files changed

+4
-82
lines changed

3 files changed

+4
-82
lines changed

CMakeLists.txt

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
cmake_minimum_required(VERSION 3.4)
1+
cmake_minimum_required(VERSION 3.12)
22
set(CMAKE_USER_MAKE_RULES_OVERRIDE "${CMAKE_CURRENT_SOURCE_DIR}/cmake/MSVC.cmake")
33
set(CMAKE_DISABLE_IN_SOURCE_BUILD ON)
44
project(V8 LANGUAGES CXX C ASM)
55

6-
option(V8CMAKE_FIND_PYTHON "Enable finding python" ON)
7-
86
if(MSVC)
97
enable_language(ASM_MASM)
108
set_property(
@@ -27,9 +25,7 @@ endif()
2725
list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake")
2826
set(THREADS_PREFER_PTHREAD_FLAG ON)
2927

30-
if (V8CMAKE_FIND_PYTHON)
31-
find_package(Python 3 REQUIRED QUIET COMPONENTS Interpreter)
32-
endif()
28+
find_package(Python3 COMPONENTS Interpreter)
3329
find_package(Threads QUIET)
3430

3531
include(CMakeDependentOption)
@@ -731,7 +727,7 @@ add_custom_command(
731727

732728
add_custom_command(
733729
COMMAND
734-
Python::Interpreter
730+
Python3::Interpreter
735731
v8/third_party/inspector_protocol/code_generator.py
736732
--config v8/src/inspector/inspector_protocol_config.json
737733
--config_value protocol.path=v8/include/js_protocol.pdl

cmake/CheckPythonModuleExists.cmake

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
1-
if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.10)
2-
include_guard(GLOBAL)
3-
elseif (__check_python_module)
4-
return()
5-
else()
6-
set(__check_python_module ON)
7-
endif()
1+
include_guard(GLOBAL)
82

93
function (check_python_module_exists result module)
104
if (CACHE{result})

cmake/FindPython.cmake

Lines changed: 0 additions & 68 deletions
This file was deleted.

0 commit comments

Comments
 (0)