Don't rely on python-config sending the help message to stderr, as older versions seem to use stdout.

This commit is contained in:
Dave Page 2020-04-29 15:49:16 +01:00
parent 505956d1fa
commit 97be3d8179

View File

@ -73,9 +73,15 @@ else {
message(Using $$PYTHON_CONFIG)
PYTHON_VERSION = $$system($$PYTHON_CONFIG --libs | grep -o -i "[0-9]\.[0-9]" | sed "s/\.//g")
QMAKE_CXXFLAGS += $$system($$PYTHON_CONFIG --includes)
QMAKE_LFLAGS += $$system($$PYTHON_CONFIG --ldflags)
LIBS += $$system($$PYTHON_CONFIG --libs --embed 2> /dev/null || $$PYTHON_CONFIG --libs)
greaterThan(PYTHON_VERSION, 37) {
LIBS += $$system($$PYTHON_CONFIG --libs --embed)
} else {
LIBS += $$system($$PYTHON_CONFIG --libs)
}
contains( LIBS, -lpython2.* ) {
DEFINES += PYTHON2