diff options
author | Peter Wu <peter@lekensteyn.nl> | 2018-10-13 15:56:02 +0200 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2018-11-07 20:46:59 +0000 |
commit | e9f7bb512735aeb91a7a3a5fc05840fb2ee27d9e (patch) | |
tree | 2851b89e07fe3d7308276624ea9b3dde93103ffc /cmake/modules | |
parent | 77114b721d6b8dfb085d13c83c9ef63cda4b8ec2 (diff) |
Require Python 3, drop Python 2 support
Python 3 is widely available. All major Linux distributions support it.
RHEL is covered via EPEL (which is already required for cmake3). Drop
support for Python 2 in order to reduce maintenance costs. The main
motivation is being able to simplify the tests.
CMake is updated to search for Python >= 3.4 and will fail if
unavailable (generating dissectors.c requires Python, so it is quite an
important piece to have).
The documentation is updated to reflect the Python 3.7 paths used by
Chocolatey. Tested the git-review installation instructions in Windows 7
x64 without a previous Chocolatey installation.
macOS brew now installs Python 3 (its dependencies are already installed
by python@2 for libxml2). The macOS (non-brew variant) is updated to use
the official 64-bit installer to install Python 3.
Change-Id: I80b1e36957f338e0dad1bfcc173b6418682cddba
Reviewed-on: https://code.wireshark.org/review/30192
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'cmake/modules')
-rw-r--r-- | cmake/modules/LocatePythonExecutable.cmake | 3 | ||||
-rw-r--r-- | cmake/modules/UseAsn2Wrs.cmake | 8 |
2 files changed, 7 insertions, 4 deletions
diff --git a/cmake/modules/LocatePythonExecutable.cmake b/cmake/modules/LocatePythonExecutable.cmake index 2f77fbdc0d..0717c1dbb1 100644 --- a/cmake/modules/LocatePythonExecutable.cmake +++ b/cmake/modules/LocatePythonExecutable.cmake @@ -3,12 +3,13 @@ # http://public.kitware.com/Bug/view.php?id=13818 if(NOT PYTHON_EXECUTABLE AND WIN32) - foreach(_major_version 3 2) + foreach(_major_version 3) foreach(_minor_version 7 6 5 4 3 2 1) if (PYTHON_EXECUTABLE) break() endif() find_program(PYTHON_EXECUTABLE + python3.exe python.exe PATHS [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_major_version}.${_minor_version}\\InstallPath] diff --git a/cmake/modules/UseAsn2Wrs.cmake b/cmake/modules/UseAsn2Wrs.cmake index d3718c806a..9d7cdfed0c 100644 --- a/cmake/modules/UseAsn2Wrs.cmake +++ b/cmake/modules/UseAsn2Wrs.cmake @@ -5,10 +5,12 @@ # source tree. For external dissectors, set it to the # absolute path (e.g. "${CMAKE_CURRENT_SOURCE_DIR}"). -include(LocatePythonModule) -locate_python_module(asn2wrs REQUIRED PATHS "${CMAKE_SOURCE_DIR}/tools") - function(ASN2WRS) + if(NOT PY_ASN2WRS) + include(LocatePythonModule) + locate_python_module(asn2wrs REQUIRED PATHS "${CMAKE_SOURCE_DIR}/tools") + endif() + if(NOT PROTO_OPT) set(PROTO_OPT -p ${PROTOCOL_NAME}) elseif(PROTO_OPT STREQUAL "_EMPTY_") |