mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-12-13 19:24:21 +00:00
Remove Python2 fallback and only advertise Python3 in the doc
Differential Revision: https://www.youtube.com/watch?v=RsL0cipURA0
This commit is contained in:
parent
978eb3b87b
commit
5e31e226b5
@ -135,20 +135,7 @@ if( CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR )
|
||||
set( CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX} )
|
||||
|
||||
if(LLVM_INCLUDE_TESTS)
|
||||
find_package(Python3 COMPONENTS Interpreter)
|
||||
if(NOT Python3_Interpreter_FOUND)
|
||||
message(WARNING "Python3 not found, using python2 as a fallback")
|
||||
find_package(Python2 COMPONENTS Interpreter REQUIRED)
|
||||
if(Python2_VERSION VERSION_LESS 2.7)
|
||||
message(SEND_ERROR "Python 2.7 or newer is required")
|
||||
endif()
|
||||
|
||||
# Treat python2 as python3
|
||||
add_executable(Python3::Interpreter IMPORTED)
|
||||
set_target_properties(Python3::Interpreter PROPERTIES
|
||||
IMPORTED_LOCATION ${Python2_EXECUTABLE})
|
||||
set(Python3_EXECUTABLE ${Python2_EXECUTABLE})
|
||||
endif()
|
||||
find_package(Python3 REQUIRED COMPONENTS Interpreter)
|
||||
|
||||
# Check prebuilt llvm/utils.
|
||||
if(EXISTS ${LLVM_TOOLS_BINARY_DIR}/FileCheck${CMAKE_EXECUTABLE_SUFFIX}
|
||||
|
@ -19,7 +19,7 @@ Should be working on UNIX operating systems.
|
||||
Prerequisites
|
||||
-------------
|
||||
|
||||
1. **python** interpreter (version 2.7, 3.2, 3.3, 3.4, 3.5).
|
||||
1. **python** interpreter (version 3.6 or later).
|
||||
|
||||
|
||||
How to use
|
||||
|
@ -5,8 +5,8 @@
|
||||
# This one has the scripting bridge enabled.
|
||||
|
||||
import sys
|
||||
if sys.version_info < (2, 7):
|
||||
print "set-xcode-analyzer requires Python 2.7 or later"
|
||||
if sys.version_info < (3, 6):
|
||||
print "set-xcode-analyzer requires Python 3.6 or later"
|
||||
sys.exit(1)
|
||||
|
||||
import os
|
||||
|
@ -57,20 +57,7 @@ if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
|
||||
include(CheckAtomic)
|
||||
|
||||
if(LLVM_INCLUDE_TESTS)
|
||||
find_package(Python3 COMPONENTS Interpreter)
|
||||
if(NOT Python3_Interpreter_FOUND)
|
||||
message(WARNING "Python3 not found, using python2 as a fallback")
|
||||
find_package(Python2 COMPONENTS Interpreter REQUIRED)
|
||||
if(Python2_VERSION VERSION_LESS 2.7)
|
||||
message(SEND_ERROR "Python 2.7 or newer is required")
|
||||
endif()
|
||||
|
||||
# Treat python2 as python3
|
||||
add_executable(Python3::Interpreter IMPORTED)
|
||||
set_target_properties(Python3::Interpreter PROPERTIES
|
||||
IMPORTED_LOCATION ${Python2_EXECUTABLE})
|
||||
set(Python3_EXECUTABLE ${Python2_EXECUTABLE})
|
||||
endif()
|
||||
find_package(Python3 REQUIRED COMPONENTS Interpreter)
|
||||
|
||||
# Check prebuilt llvm/utils.
|
||||
if(EXISTS ${LLVM_TOOLS_BINARY_DIR}/FileCheck${CMAKE_EXECUTABLE_SUFFIX}
|
||||
|
@ -73,7 +73,7 @@ commands below.
|
||||
> yum install libedit-devel libxml2-devel ncurses-devel python-devel swig
|
||||
> sudo apt-get install build-essential subversion swig python3-dev libedit-dev libncurses5-dev
|
||||
> pkg install swig python
|
||||
> pkgin install swig python27 cmake ninja-build
|
||||
> pkgin install swig python36 cmake ninja-build
|
||||
> brew install swig cmake ninja
|
||||
|
||||
Note that there's an `incompatibility
|
||||
|
@ -708,20 +708,7 @@ set(ENABLE_EXPERIMENTAL_NEW_PASS_MANAGER FALSE CACHE BOOL
|
||||
|
||||
include(HandleLLVMOptions)
|
||||
|
||||
find_package(Python3 COMPONENTS Interpreter)
|
||||
if(NOT Python3_Interpreter_FOUND)
|
||||
message(WARNING "Python3 not found, using python2 as a fallback")
|
||||
find_package(Python2 COMPONENTS Interpreter REQUIRED)
|
||||
if(Python2_VERSION VERSION_LESS 2.7)
|
||||
message(SEND_ERROR "Python 2.7 or newer is required")
|
||||
endif()
|
||||
|
||||
# Treat python2 as python3
|
||||
add_executable(Python3::Interpreter IMPORTED)
|
||||
set_target_properties(Python3::Interpreter PROPERTIES
|
||||
IMPORTED_LOCATION ${Python2_EXECUTABLE})
|
||||
set(Python3_EXECUTABLE ${Python2_EXECUTABLE})
|
||||
endif()
|
||||
find_package(Python3 REQUIRED COMPONENTS Interpreter)
|
||||
|
||||
######
|
||||
|
||||
|
@ -170,7 +170,7 @@ Package Version Notes
|
||||
=========================================================== ============ ==========================================
|
||||
`CMake <http://cmake.org/>`__ >=3.13.4 Makefile/workspace generator
|
||||
`GCC <http://gcc.gnu.org/>`_ >=5.1.0 C/C++ compiler\ :sup:`1`
|
||||
`python <http://www.python.org/>`_ >=2.7 Automated test suite\ :sup:`2`
|
||||
`python <http://www.python.org/>`_ >=3.6 Automated test suite\ :sup:`2`
|
||||
`zlib <http://zlib.net>`_ >=1.2.3.4 Compression library\ :sup:`3`
|
||||
`GNU Make <http://savannah.gnu.org/projects/make>`_ 3.79, 3.79.1 Makefile/build processor\ :sup:`4`
|
||||
=========================================================== ============ ==========================================
|
||||
|
@ -51,7 +51,7 @@ You will also need the `CMake <http://www.cmake.org/>`_ build system since it
|
||||
generates the project files you will use to build with.
|
||||
|
||||
If you would like to run the LLVM tests you will need `Python
|
||||
<http://www.python.org/>`_. Version 2.7 and newer are known to work. You will
|
||||
<http://www.python.org/>`_. Version 3.6 and newer are known to work. You will
|
||||
need `GnuWin32 <http://gnuwin32.sourceforge.net/>`_ tools, too.
|
||||
|
||||
Do not install the LLVM directory tree into a path containing spaces (e.g.
|
||||
|
@ -41,7 +41,6 @@ on the ARMv6 and ARMv7 architectures and may be inapplicable to older chips.
|
||||
|
||||
Use Ninja instead of Make: "-G Ninja"
|
||||
Build with assertions on: "-DLLVM_ENABLE_ASSERTIONS=True"
|
||||
Force Python2: "-DPYTHON_EXECUTABLE=/usr/bin/python2"
|
||||
Local (non-sudo) install path: "-DCMAKE_INSTALL_PREFIX=$HOME/llvm/install"
|
||||
CPU flags: "DCMAKE_C_FLAGS=-mcpu=cortex-a15" (same for CXX_FLAGS)
|
||||
|
||||
|
@ -23,7 +23,7 @@ Requirements
|
||||
============
|
||||
|
||||
In order to use the LLVM testing infrastructure, you will need all of the
|
||||
software required to build LLVM, as well as `Python <http://python.org>`_ 2.7 or
|
||||
software required to build LLVM, as well as `Python <http://python.org>`_ 3.6 or
|
||||
later.
|
||||
|
||||
LLVM Testing Infrastructure Organization
|
||||
|
Loading…
Reference in New Issue
Block a user