Skip to content

Commit bb07bcf

Browse files
author
Hima Bindu Meda
committed
8313321: Set minimum python version in WebKit cmake scripts
Reviewed-by: kcr, sykora
1 parent cd7383a commit bb07bcf

1 file changed

Lines changed: 18 additions & 4 deletions

File tree

modules/javafx.web/src/main/native/Source/cmake/WebKitCommon.cmake

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -189,10 +189,24 @@ if (NOT HAS_RUN_WEBKIT_COMMON)
189189
find_package(Perl 5.10.0 REQUIRED)
190190
find_package(PerlModules COMPONENTS English FindBin JSON::PP REQUIRED)
191191

192-
# This module looks preferably for version 3 of Python. If not found, version 2 is searched.
193-
find_package(Python COMPONENTS Interpreter REQUIRED)
194-
# Set the variable with uppercase name to keep compatibility with code and users expecting it.
195-
set(PYTHON_EXECUTABLE ${Python_EXECUTABLE} CACHE FILEPATH "Path to the Python interpreter")
192+
# This module looks preferably for version 3 of Python.
193+
if (CMAKE_SYSTEM_NAME MATCHES "Windows")
194+
find_package(Python3 3.8.0 REQUIRED)
195+
find_package(Python3 COMPONENTS Interpreter REQUIRED)
196+
# Set the variable with uppercase name to keep compatibility with code and users expecting it.
197+
set(PYTHON_EXECUTABLE ${Python3_EXECUTABLE} CACHE FILEPATH "Path to the Python interpreter")
198+
if (NOT PYTHON_EXECUTABLE OR Python3_VERSION VERSION_LESS 3.8.0)
199+
message(FATAL_ERROR "Python 3.8 or higher is required.")
200+
endif ()
201+
else ()
202+
find_package(Python3 3.6.0 REQUIRED)
203+
find_package(Python3 COMPONENTS Interpreter REQUIRED)
204+
# Set the variable with uppercase name to keep compatibility with code and users expecting it.
205+
set(PYTHON_EXECUTABLE ${Python3_EXECUTABLE} CACHE FILEPATH "Path to the Python interpreter")
206+
if (NOT PYTHON_EXECUTABLE OR Python3_VERSION VERSION_LESS 3.6.0)
207+
message(FATAL_ERROR "Python 3.6 or higher is required.")
208+
endif ()
209+
endif ()
196210

197211
# We cannot check for RUBY_FOUND because it is set only when the full package is installed and
198212
# the only thing we need is the interpreter. Unlike Python, cmake does not provide a macro

0 commit comments

Comments
 (0)