Port python check to configure system
Also check for py, python2, python3 executables. Task-number: QTBUG-72926 Fixes: QTBUG-84038 Pick-to: 5.15 Change-Id: I844db4dd630d9b3025eca529ee57565b600ebbac Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
This commit is contained in:
parent
adfff7ec77
commit
2b41025fc9
|
@ -5,11 +5,3 @@ requires(qtConfig(commandlineparser))
|
|||
requires(qtConfig(temporaryfile))
|
||||
|
||||
load(qt_parts)
|
||||
|
||||
!python_available {
|
||||
py_out = $$system('python -c "print(1)"')
|
||||
!equals(py_out, 1): error("Building QtQml requires Python.")
|
||||
tmp = python_available
|
||||
CONFIG += $$tmp
|
||||
cache(CONFIG, add, tmp)
|
||||
}
|
||||
|
|
|
@ -58,7 +58,7 @@ contains(DEFINES, WTF_USE_UDIS86=1) {
|
|||
udis86.output = udis86_itab.h
|
||||
udis86.input = ITAB
|
||||
udis86.CONFIG += no_link
|
||||
udis86.commands = python $$PWD/disassembler/udis86/itab.py ${QMAKE_FILE_IN}
|
||||
udis86.commands = $QMAKE_PYTHON $$PWD/disassembler/udis86/itab.py ${QMAKE_FILE_IN}
|
||||
QMAKE_EXTRA_COMPILERS += udis86
|
||||
|
||||
udis86_tab_cfile.target = $$OUT_PWD/udis86_itab.c
|
||||
|
@ -111,7 +111,7 @@ retgen.output = $$GENERATEDDIR/RegExpJitTables.h
|
|||
retgen.script = $$PWD/yarr/create_regex_tables
|
||||
retgen.input = retgen.script
|
||||
retgen.CONFIG += no_link
|
||||
retgen.commands = python $$retgen.script > ${QMAKE_FILE_OUT}
|
||||
retgen.commands = $$QMAKE_PYTHON $$retgen.script > ${QMAKE_FILE_OUT}
|
||||
QMAKE_EXTRA_COMPILERS += retgen
|
||||
|
||||
# Taken from WebKit/Tools/qmake/mkspecs/features/unix/default_post.prf
|
||||
|
|
|
@ -69,6 +69,11 @@
|
|||
"#endif"
|
||||
]
|
||||
}
|
||||
},
|
||||
"qml-python": {
|
||||
"label": "python",
|
||||
"type": "detectPython",
|
||||
"log": "location"
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -185,9 +190,25 @@
|
|||
"section": "QML",
|
||||
"condition": "features.itemmodel",
|
||||
"output": [ "privateFeature" ]
|
||||
},
|
||||
"qml-python": {
|
||||
"label": "python",
|
||||
"condition": "tests.qml-python",
|
||||
"output": [
|
||||
"privateFeature",
|
||||
{ "type": "varAssign", "name": "QMAKE_PYTHON", "value": "tests.qml-python.location" }
|
||||
]
|
||||
}
|
||||
},
|
||||
|
||||
"report": [
|
||||
{
|
||||
"type": "error",
|
||||
"condition": "!features.qml-python",
|
||||
"message": "Python is required to build QtQml."
|
||||
}
|
||||
],
|
||||
|
||||
"summary": [
|
||||
{
|
||||
"section": "Qt QML",
|
||||
|
|
|
@ -0,0 +1,22 @@
|
|||
equals(QMAKE_HOST.os, Windows): EXE_SUFFIX = .exe
|
||||
|
||||
defineTest(qtConfTest_detectPython) {
|
||||
PYTHON_NAMES = python$$EXE_SUFFIX python2$${EXE_SUFFIX} python3$${EXE_SUFFIX} py$${EXE_SUFFIX}
|
||||
for (name, PYTHON_NAMES) {
|
||||
python_path = $$qtConfFindInPath("$$name")
|
||||
!isEmpty(python_path): \
|
||||
break()
|
||||
}
|
||||
isEmpty(python_path) {
|
||||
qtLog("No $$PYTHON_NAMES are found in PATH. Giving up.")
|
||||
return(false)
|
||||
}
|
||||
|
||||
# Make tests.python.location available in configure.json.
|
||||
$${1}.location = $$clean_path($$python_path)
|
||||
export($${1}.location)
|
||||
$${1}.cache += location
|
||||
export($${1}.cache)
|
||||
|
||||
return(true)
|
||||
}
|
|
@ -7,6 +7,9 @@ qtConfig(qml-network): \
|
|||
TRACEPOINT_PROVIDER = $$PWD/qtqml.tracepoints
|
||||
CONFIG += qt_tracepoints
|
||||
|
||||
!qtConfig(qml-python): \
|
||||
error(Python is required to build QtQml.)
|
||||
|
||||
DEFINES += QT_NO_URL_CAST_FROM_STRING QT_NO_INTEGER_EVENT_COORDINATES
|
||||
|
||||
msvc:equals(QT_ARCH, i386): QMAKE_LFLAGS += /BASE:0x66000000
|
||||
|
@ -63,7 +66,6 @@ qtConfig(qml-animation) {
|
|||
}
|
||||
include(types/types.pri)
|
||||
include(../3rdparty/masm/masm-defs.pri)
|
||||
include(../3rdparty/masm/masm.pri)
|
||||
|
||||
MODULE_PLUGIN_TYPES = \
|
||||
qmltooling
|
||||
|
@ -75,3 +77,5 @@ QML_IMPORT_VERSION = $$QT_VERSION
|
|||
CONFIG += qmltypes install_qmltypes install_metatypes
|
||||
|
||||
load(qt_module)
|
||||
|
||||
include(../3rdparty/masm/masm.pri)
|
||||
|
|
Loading…
Reference in New Issue