Skip to content

Commit

Permalink
Force c++latest for Qt6, it does not know about c++11
Browse files Browse the repository at this point in the history
  • Loading branch information
iakov committed Aug 23, 2024
1 parent 5195093 commit 317cb18
Show file tree
Hide file tree
Showing 138 changed files with 48,854 additions and 60,827 deletions.
18 changes: 11 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,13 @@ 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)
PYTHONDEVMODE=1 PYTHONASYNCIODEBUG=1 PYTHONWARNINGS=error PYTHONMALLOC=malloc_debug \
UBSAN_OPTIONS="halt_on_error=1" ASAN_OPTIONS="detect_leaks=0:detect_stack_use_after_return=1:fast_unwind_on_malloc=0" \
make check TESTARGS="-platform offscreen"
make check
- name: Run memory tests with sanitizers
run: |
Expand All @@ -84,7 +85,7 @@ jobs:
PYTHONDEVMODE=1 PYTHONASYNCIODEBUG=1 PYTHONWARNINGS=error PYTHONMALLOC=malloc_debug \
UBSAN_OPTIONS="halt_on_error=1" ASAN_OPTIONS="detect_leaks=1:detect_stack_use_after_return=1:fast_unwind_on_malloc=0" \
PYTHONQT_RUN_ONLY_MEMORY_TESTS=1 \
make check TESTARGS="-platform minimal"
make check
- name: Generate Wrappers
run: |
Expand Down Expand Up @@ -155,10 +156,11 @@ 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 \
make check TESTARGS="-platform offscreen"
make check
- name: Generate Wrappers
run: |
Expand Down Expand Up @@ -237,18 +239,19 @@ 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 \
-r PythonQt.pro
make -j $(nproc)
PYTHONDEVMODE=1 PYTHONASYNCIODEBUG=1 PYTHONWARNINGS=error PYTHONMALLOC=malloc_debug \
UBSAN_OPTIONS="halt_on_error=1" ASAN_OPTIONS="detect_leaks=0:detect_stack_use_after_return=1:fast_unwind_on_malloc=0" \
make check TESTARGS="-platform offscreen"
make check
- name: Generate Wrappers
if: ${{ contains(matrix.configuration, 'release') }}
Expand Down Expand Up @@ -352,14 +355,15 @@ 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
set PYTHONDEVMODE=1
set PYTHONASYNCIODEBUG=1
set PYTHONWARNINGS=error
mingw32-make -j 2 && mingw32-make check "TESTARGS=-platform offscreen" ^
|| set CL=/MP && nmake && nmake check "TESTARGS=-platform offscreen"
mingw32-make -j 2 && mingw32-make check ^
|| set CL=/MP && nmake && nmake check
- name: Generate Wrappers
shell: cmd
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/build_latest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,13 @@ 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)
PYTHONDEVMODE=1 PYTHONASYNCIODEBUG=1 PYTHONWARNINGS=error PYTHONMALLOC=malloc_debug \
UBSAN_OPTIONS="halt_on_error=1" ASAN_OPTIONS="detect_leaks=0:detect_stack_use_after_return=1:fast_unwind_on_malloc=0" \
make check TESTARGS="-platform offscreen"
make check
- name: Build PythonQt Windows
shell: cmd
Expand All @@ -119,11 +120,12 @@ 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 }}" ^
PythonQt.pro
set PYTHONDEVMODE=1
set PYTHONASYNCIODEBUG=1
set PYTHONWARNINGS=error
nmake && nmake check "TESTARGS=-platform offscreen"
nmake && nmake check
4 changes: 2 additions & 2 deletions build/common.prf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
20 changes: 15 additions & 5 deletions build/python.prf
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -42,7 +42,17 @@ contains(PKGCONFIG, "python.*"){
# This can help with GNU/Linux (including macOS with Homebrew), MSYS2/MinGW environment,
# and also with OpenEmbedded and other cross-builds
CONFIG += link_pkgconfig
PYTHON_PKGCONFIG = $$member($$unique($$find(PKGCONFIG, "python.*")), 1, 1)
PYTHON_PKGCONFIG = $$unique(PKGCONFIG)
PYTHON_PKGCONFIG = $$find(PYTHON_PKGCONFIG, "python.*")
PYTHON_PKGCONFIG = $$member(PYTHON_PKGCONFIG)
!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,)
Expand Down
99 changes: 26 additions & 73 deletions extensions/PythonQt_QtAll/PythonQt_QtAll.pro
Original file line number Diff line number Diff line change
Expand Up @@ -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, 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 317cb18

Please sign in to comment.