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 22, 2024
1 parent 5195093 commit fc73b27
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion 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
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 Down
11 changes: 7 additions & 4 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 Down Expand Up @@ -46,6 +46,9 @@ contains(PKGCONFIG, "python.*"){
# add rpath
PYTHON_LIBDIR = $$system($$pkgConfigExecutable() --libs-only-L $$PYTHON_PKGCONFIG)
QMAKE_RPATHDIR += $$replace(PYTHON_LIBDIR,-L,)
PYTHON_VERSION_BY_PKGCONFIG = $$system($$pkgConfigExecutable() --modversion $$PYTHON_PKGCONFIG)
!equals(PYTHON_VERSION, $$PYTHON_VERSION_BY_PKGCONFIG):error(PYTHON_VERSION must be equal to the corresponding one from PKGCONFIG)

} else:macx:isEmpty(PYTHON_DIR){
# for macx you need to have the Python development kit installed as framework
INCLUDEPATH += /System/Library/Frameworks/Python.framework/Headers
Expand Down
2 changes: 1 addition & 1 deletion src/src.pri
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ DEFINES += PYTHONQT_EXPORTS

INCLUDEPATH += $$PWD

CONFIG += c++11
CONFIG += c++11 c++latest

gcc:!no_warn:!clang:QMAKE_CXXFLAGS += -Wno-error=missing-field-initializers
*-clang*:!no_warn:QMAKE_CXXFLAGS += -Wno-error=sometimes-uninitialized
Expand Down

0 comments on commit fc73b27

Please sign in to comment.