1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-09 11:13:12 +02:00

core: compile with Python 3 by default

The CMake option ENABLE_PYTHON3 is renamed to ENABLE_PYTHON2, to use Python 2
first then fallback on Python 3.

In the same way, the configure option --enable-python3 is renamed to
--enable-python2, to use Python 2 first then fallback on Python 3.
This commit is contained in:
Sébastien Helleu
2019-07-01 21:26:48 +02:00
parent f9b6f359dd
commit ab81128a7a
8 changed files with 21 additions and 17 deletions
+6 -6
View File
@@ -33,14 +33,14 @@ if(PYTHON_FOUND)
set(PYTHON_FIND_QUIETLY TRUE)
endif()
if(ENABLE_PYTHON3)
if(ENABLE_PYTHON2)
find_program(PYTHON_EXECUTABLE
NAMES python3.7 python3.6 python3.5 python3.4 python3.3 python3.2 python3.1 python3.0 python3 python2.7 python2.6 python2.5 python
NAMES python2.7 python2.6 python2.5 python3.7 python3.6 python3.5 python3.4 python3.3 python3.2 python3.1 python3.0 python3 python
PATHS /usr/bin /usr/local/bin /usr/pkg/bin
)
else()
find_program(PYTHON_EXECUTABLE
NAMES python2.7 python2.6 python2.5 python
NAMES python3.7 python3.6 python3.5 python3.4 python3.3 python3.2 python3.1 python3.0 python3 python
PATHS /usr/bin /usr/local/bin /usr/pkg/bin
)
endif()
@@ -65,14 +65,14 @@ if(PYTHON_EXECUTABLE)
NAMES Python.h
HINTS ${PYTHON_INC_DIR}
)
if(ENABLE_PYTHON3)
if(ENABLE_PYTHON2)
find_library(PYTHON_LIBRARY
NAMES python3.7 python3.6 python3.5 python3.4 python3.3 python3.2 python3.1 python3.0 python3 python2.7 python2.6 python2.5 python
NAMES python2.7 python2.6 python2.5 python3.7 python3.6 python3.5 python3.4 python3.3 python3.2 python3.1 python3.0 python3 python
HINTS ${PYTHON_POSSIBLE_LIB_PATH}
)
else()
find_library(PYTHON_LIBRARY
NAMES python2.7 python2.6 python2.5 python
NAMES python3.7 python3.6 python3.5 python3.4 python3.3 python3.2 python3.1 python3.0 python3 python
HINTS ${PYTHON_POSSIBLE_LIB_PATH}
)
endif()