Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Force c++latest for Qt6, it does not know about c++11
Browse files Browse the repository at this point in the history
iakov committed Aug 23, 2024
1 parent 5195093 commit 2f0af6e
Showing 120 changed files with 115,475 additions and 4,346 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -67,6 +67,7 @@ jobs:
echo ============================
qmake -r PythonQt.pro CONFIG+=ccache CONFIG+=release CONFIG+=force_debug_info \
CONFIG+=sanitizer CONFIG+=sanitize_undefined CONFIG+=sanitize_address \
CONFIG+=tests CONFIG+=generator \
PYTHON_VERSION=$(python3 --version | cut -d " " -f 2 | cut -d "." -f1,2) \
PYTHON_DIR=$(which python3 | xargs dirname | xargs dirname)
make -j $(nproc)
@@ -155,6 +156,7 @@ jobs:
echo PYTHON_VERSION_SHORT=${PYTHON_VERSION_SHORT}
echo PYTHON_DIR=${PYTHON_DIR}
qmake-qt5 -r PythonQt.pro CONFIG+=${{ matrix.configuration }} \
CONFIG+=tests CONFIG+=generator \
"PYTHON_VERSION=${PYTHON_VERSION_SHORT}" "PYTHON_DIR=${PYTHON_DIR}"
make -j $(nproc) && \
PYTHONDEVMODE=1 PYTHONASYNCIODEBUG=1 PYTHONWARNINGS=error PYTHONMALLOC=malloc_debug \
@@ -237,10 +239,11 @@ jobs:
uname -a; gcc --version | head -n 1; python --version; qmake --version
echo ============================
PYTHON_VERSION_MAJOR=$(cut -d . -f1 <<< ${{ steps.versions.outputs.PYTHON_VERSION_SHORT }})
for i in "python${{ steps.versions.outputs.PYTHON_VERSION_SHORT }}-embed" "python${{ steps.versions.outputs.PYTHON_VERSION_SHORT }}" \
for i in "python-${{ steps.versions.outputs.PYTHON_VERSION_SHORT }}-embed" "python-${{ steps.versions.outputs.PYTHON_VERSION_SHORT }}" \
"python${PYTHON_VERSION_MAJOR}-embed" "python${PYTHON_VERSION_MAJOR}"
do if pkg-config --exists "$i"; then PYTHON_PKGCONFIG_NAME="$i"; break; fi; done
qmake CONFIG+=ccache CONFIG+=${{ matrix.configuration }} CONFIG+=sanitizer CONFIG+=sanitize_undefined CONFIG+=sanitize_address \
CONFIG+=tests CONFIG+=generator \
PYTHON_VERSION=${{ steps.versions.outputs.PYTHON_VERSION_SHORT }} \
PYTHON_DIR="$pythonLocation" \
PKGCONFIG+=$PYTHON_PKGCONFIG_NAME \
@@ -352,6 +355,7 @@ jobs:
python --version
set PYTHONQTALL_CONFIG=${{ matrix.pythonqtall-config }}
qmake CONFIG+=release CONFIG-=debug_and_release CONFIG-=debug_and_release_target ^
CONFIG+=tests CONFIG+=generator ^
"PYTHON_PATH=%pythonLocation%" ^
"PYTHON_VERSION=${{ steps.versions.outputs.PYTHON_VERSION_SHORT }}" ^
PythonQt.pro
2 changes: 2 additions & 0 deletions .github/workflows/build_latest.yml
Original file line number Diff line number Diff line change
@@ -105,6 +105,7 @@ jobs:
echo ============================
qmake -r PythonQt.pro CONFIG+=ccache CONFIG+=release CONFIG+=force_debug_info \
CONFIG+=sanitizer CONFIG+=sanitize_undefined CONFIG+=sanitize_address \
CONFIG+=tests \
PYTHON_VERSION=$(python3 --version | cut -d " " -f 2 | cut -d "." -f1,2) \
PYTHON_DIR=$(which python3 | xargs dirname | xargs dirname)
make -j $(nproc)
@@ -119,6 +120,7 @@ jobs:
qmake -query
python --version
qmake CONFIG+=release CONFIG-=debug_and_release CONFIG-=debug_and_release_target ^
CONFIG+=tests ^
"PYTHONQTALL_CONFIG=${{ matrix.pythonqtall-config }}" ^
"PYTHON_PATH=%pythonLocation%" ^
"PYTHON_VERSION=${{ steps.setenv.outputs.PYTHON_VERSION_SHORT }}" ^
4 changes: 2 additions & 2 deletions build/common.prf
Original file line number Diff line number Diff line change
@@ -39,7 +39,7 @@ PYTHONQT_GENERATED_PATH = $$PWD/../generated_cpp
error(Unsupported Qt version for PythonQt: missing generated_cpp)
}

greaterThan(QT_MAJOR_VERSION, 5) | greaterThan(QT_MINOR_VERSION, 9): CONFIG += c++11
greaterThan(QT_MAJOR_VERSION, 5) | greaterThan(QT_MINOR_VERSION, 9): CONFIG += c++latest c++11
win32: CONFIG += skip_target_version_ext
gcc|win32-clang-msvc:QMAKE_CXXFLAGS += -Wno-deprecated-declarations -Wuninitialized -Winit-self -ansi -pedantic
win32-clang-msvc:QMAKE_CXXFLAGS += -Wno-unused-command-line-argument
@@ -49,7 +49,7 @@ gcc:!isEmpty(QT_INSTALL_HEADERS): QMAKE_CXXFLAGS += -isystem $$[QT_INSTALL_HEADE
QMAKE_CXXFLAGS -= -Werror -Werror=pedantic -pedantic-errors -Werror=write-strings
clang:QMAKE_CXXFLAGS += -Wno-error -Wno-error=sometimes-uninitialized -Wno-unused-variable -Wno-sign-compare -Wno-error=unreachable-code

QMAKE_CXXFLAGS += -Wno-cast-qual \
gcc:QMAKE_CXXFLAGS += -Wno-cast-qual \
-Wno-conversion-null \
-Wno-sign-compare -Wno-unused-parameter -Wno-error=type-limits \
-Wno-error=parentheses -Wno-deprecated-declarations
16 changes: 12 additions & 4 deletions build/python.prf
Original file line number Diff line number Diff line change
@@ -5,17 +5,17 @@
isEmpty( PYTHON_VERSION ) {
PYTHON_VERSION=$$(PYTHON_VERSION)
}
isEmpty( PYTHON_VERSION ) {
PYTHON_VERSION=2.7
}

isEmpty( PYTHON_DIR ) {
PYTHON_DIR=$$(PYTHON_DIR)
}
!isEmpty( PYTHON_DIR ) {
PYTHON_DIR=$${PYTHON_DIR}/
}

isEmpty( PYTHON_VERSION ) {
error(Missing PYTHON_VERSION)
}

PYTHON_VERSION_MAJOR=$$section(PYTHON_VERSION, ., 0, 0)
PYTHON_VERSION_MINOR=$$section(PYTHON_VERSION, ., 1, 1)

@@ -43,6 +43,14 @@ contains(PKGCONFIG, "python.*"){
# and also with OpenEmbedded and other cross-builds
CONFIG += link_pkgconfig
PYTHON_PKGCONFIG = $$member($$unique($$find(PKGCONFIG, "python.*")), 1, 1)
!system($$pkgConfigExecutable() --modversion $$PYTHON_PKGCONFIG) {
message(PKGCONFIG is $$PKGCONFIG)
error(Bad or missing Python development package $$PYTHON_PKGCONFIG passed via PKGCONFIG argument)
}
PYTHON_VERSION_BY_PKGCONFIG = $$system($$pkgConfigExecutable() --modversion $$PYTHON_PKGCONFIG)
!equals(PYTHON_VERSION, $$PYTHON_VERSION_BY_PKGCONFIG):error(PYTHON_VERSION $$PYTHON_VERSION \
must be equal to the corresponding one from PKGCONFIG $$PYTHON_VERSION_BY_PKGCONFIG)

# add rpath
PYTHON_LIBDIR = $$system($$pkgConfigExecutable() --libs-only-L $$PYTHON_PKGCONFIG)
QMAKE_RPATHDIR += $$replace(PYTHON_LIBDIR,-L,)
99 changes: 26 additions & 73 deletions extensions/PythonQt_QtAll/PythonQt_QtAll.pro
Original file line number Diff line number Diff line change
@@ -76,93 +76,46 @@ INSTALLS += target headers

defineTest(Xinclude) {
f=$$PYTHONQT_GENERATED_PATH/$$1/$${1}.pri
exists($$f):include($$f):export(HEADERS):export(SOURCES):export(DEFINES)

exists($$f) {
DEFINES += $$2 # shoud be in the included (generated) .pri file
QT += $$3 # shoud be in the included (generated) .pri file
include($$f)
export(HEADERS)
export(SOURCES)
export(DEFINES)
export(QT)
return(true)
}
return(false)
}

PythonQtCore:Xinclude(com_trolltech_qt_core, PYTHONQT_WITH_CORE, core)

PythonQtCore {
DEFINES += PYTHONQT_WITH_CORE
Xinclude (com_trolltech_qt_core)
QT += core
}

PythonQtGui {
DEFINES += PYTHONQT_WITH_GUI
Xinclude (com_trolltech_qt_gui)
QT += gui widgets printsupport
}
PythonQtGui:Xinclude(com_trolltech_qt_gui, PYTHONQT_WITH_GUI, gui widgets printsupport)

PythonQtSvg {
DEFINES += PYTHONQT_WITH_SVG
Xinclude (com_trolltech_qt_svg)
QT +=svg
PythonQtSvg:Xinclude(com_trolltech_qt_svg, PYTHONQT_WITH_SVG, svg) {
!lessThan(QT_MAJOR_VERSION,6): QT += svgwidgets
}

PythonQtSql {
DEFINES += PYTHONQT_WITH_SQL
Xinclude (com_trolltech_qt_sql)
QT += sql
}
PythonQtSql:Xinclude(com_trolltech_qt_sql, PYTHONQT_WITH_SQL, sql)

PythonQtNetwork {
DEFINES += PYTHONQT_WITH_NETWORK
Xinclude (com_trolltech_qt_network)
QT += network
}
PythonQtNetwork:Xinclude(com_trolltech_qt_network, PYTHONQT_WITH_NETWORK, network)

PythonQtOpengl {
DEFINES += PYTHONQT_WITH_OPENGL
QT += opengl
PythonQtCore: Xinclude (com_trolltech_qt_opengl)
QT += xml
}
PythonQtOpengl:Xinclude(com_trolltech_qt_opengl, PYTHONQT_WITH_OPENGL, opengl xml) #why xml is here too?

PythonQtXml {
DEFINES += PYTHONQT_WITH_XML
Xinclude (com_trolltech_qt_xml)
QT += xml
}
PythonQtXml:Xinclude(com_trolltech_qt_xml, PYTHONQT_WITH_XML, QT += xml)

PythonQtXmlpatterns {
DEFINES += PYTHONQT_WITH_XMLPATTERNS
Xinclude (com_trolltech_qt_xmlpatterns)
QT += xmlpatterns
}
PythonQtXmlpatterns:Xinclude(com_trolltech_qt_xmlpatterns, PYTHONQT_WITH_XMLPATTERNS, xmlpatterns)

PythonQtMultimedia {
DEFINES += PYTHONQT_WITH_MULTIMEDIA
Xinclude (com_trolltech_qt_multimedia)
QT += multimedia multimediawidgets
}
PythonQtMultimedia:Xinclude(com_trolltech_qt_multimedia, PYTHONQT_WITH_MULTIMEDIA, multimedia multimediawidgets)

PythonQtQml {
DEFINES += PYTHONQT_WITH_QML
Xinclude (com_trolltech_qt_qml)
QT += qml
}
PythonQtQml:Xinclude(com_trolltech_qt_qml, PYTHONQT_WITH_QML, qml)

PythonQtQuick {
DEFINES += PYTHONQT_WITH_QUICK
Xinclude (com_trolltech_qt_quick)
QT += quick quickwidgets
}
PythonQtQuick:Xinclude(com_trolltech_qt_quick, PYTHONQT_WITH_QUICK, quick quickwidgets)

PythonQtUiTools {
DEFINES += PYTHONQT_WITH_UITOOLS
Xinclude (com_trolltech_qt_uitools)
QT += uitools
}
PythonQtUiTools:Xinclude(com_trolltech_qt_uitools, PYTHONQT_WITH_UITOOLS, uitools)

PythonQtWebEngineWidgets {
DEFINES += PYTHONQT_WITH_WEBENGINEWIDGETS
Xinclude (com_trolltech_qt_webenginewidgets)
QT += webenginewidgets
}
PythonQtWebEngineWidgets:Xinclude(com_trolltech_qt_webenginewidgets, PYTHONQT_WITH_WEBENGINEWIDGETS, webenginewidgets)

PythonQtWebKit:Xinclude(com_trolltech_qt_webkit, PYTHONQT_WITH_WEBKIT, webkit webkitwidgets)

PythonQtWebKit {
DEFINES += PYTHONQT_WITH_WEBKIT
Xinclude (com_trolltech_qt_webkit)
QT += webkit webkitwidgets
}
1 change: 0 additions & 1 deletion generated_cpp_5.11

This file was deleted.

Loading

0 comments on commit 2f0af6e

Please sign in to comment.