Skip to content

Commit 8ea8264

Browse files
kropsboehmann
authored andcommitted
Fix build with Python 3.8
With Python 3.8, python3-config --libs doesn't contain the python link target. To avoid link issues, we first test if the python config utility accepts the '--embed' parameter and use the output when possible. Fixes: issue#6
1 parent b58b776 commit 8ea8264

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

build/python.prf

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ macx {
4141
# on linux, python-config is used to autodetect Python.
4242
# make sure that you have installed a matching python-dev package.
4343

44-
unix:LIBS += $$system(python$${PYTHON_VERSION}-config --ldflags)
44+
system(python$${PYTHON_VERSION}-config --embed --libs) {
45+
unix:LIBS += $$system(python$${PYTHON_VERSION}-config --embed --libs)
46+
} else: unix:LIBS += $$system(python$${PYTHON_VERSION}-config --libs)
4547
unix:QMAKE_CXXFLAGS += $$system(python$${PYTHON_VERSION}-config --includes)
4648
}

0 commit comments

Comments
 (0)