Another attempt at fixing the 'do we need the --embed flag for Python' problem.
This change looks at the output from python-config --help (which may go to stderr or stdout), and if it includes --embed, adds it to the later call to get the libs string.pull/32/head
parent
97be3d8179
commit
e8a4b46ba1
|
@ -73,15 +73,11 @@ else {
|
||||||
|
|
||||||
message(Using $$PYTHON_CONFIG)
|
message(Using $$PYTHON_CONFIG)
|
||||||
|
|
||||||
PYTHON_VERSION = $$system($$PYTHON_CONFIG --libs | grep -o -i "[0-9]\.[0-9]" | sed "s/\.//g")
|
PYTHON_EMBED = $$system($$PYTHON_CONFIG --help 2>&1 | grep -o \'\\-\\-embed\')
|
||||||
|
|
||||||
QMAKE_CXXFLAGS += $$system($$PYTHON_CONFIG --includes)
|
QMAKE_CXXFLAGS += $$system($$PYTHON_CONFIG --includes)
|
||||||
QMAKE_LFLAGS += $$system($$PYTHON_CONFIG --ldflags)
|
QMAKE_LFLAGS += $$system($$PYTHON_CONFIG --ldflags)
|
||||||
greaterThan(PYTHON_VERSION, 37) {
|
LIBS += $$system($$PYTHON_CONFIG --libs $$PYTHON_EMBED)
|
||||||
LIBS += $$system($$PYTHON_CONFIG --libs --embed)
|
|
||||||
} else {
|
|
||||||
LIBS += $$system($$PYTHON_CONFIG --libs)
|
|
||||||
}
|
|
||||||
|
|
||||||
contains( LIBS, -lpython2.* ) {
|
contains( LIBS, -lpython2.* ) {
|
||||||
DEFINES += PYTHON2
|
DEFINES += PYTHON2
|
||||||
|
|
Loading…
Reference in New Issue