leozide / leocad

A CAD application for creating virtual LEGO models
https://www.leocad.org
2.49k stars 211 forks source link

CONFIG += c++17 breaks 'LeoCAD requires Qt 5.4 or later' requirement #958

Open trevorsandy opened 2 weeks ago

trevorsandy commented 2 weeks ago

https://github.com/leozide/leocad/blob/ed29dad76a59f41b8ab0f666642027e1c51772af/leocad.pro#L26

CONFIG += c++17 was introduced in Qt 5.11.3 so LeoCAD will require Qt 5.11.3 or later to compile successfully.

To honour LeoCAD requiring Qt 5.4 or later, lines 9 - 26 of leocad.pro could look like this:

equals(QT_MAJOR_VERSION, 5) {
        lessThan(QT_MINOR_VERSION, 4) {
                error("LeoCAD requires Qt5.4 or later.")
        } else:win32-msvc* {
                QMAKE_CXXFLAGS += /std:c++17
        } else:unix {
                greaterThan(QT_MINOR_VERSION, 11) {
                        CONFIG += c++17
                } else {
                        QMAKE_CXXFLAGS += -std=c++17
                }
        }
}

greaterThan(QT_MAJOR_VERSION, 5) {
    QT += openglwidgets
    win32-msvc* {
        QMAKE_CXXFLAGS += /std:c++17
        } else {
                CONFIG += c++17
        }
}

qtHaveModule(gamepad) {
    QT += gamepad
    DEFINES += LC_ENABLE_GAMEPAD
}

INCLUDEPATH += qt common
CONFIG += precompile_header incremental force_debug_info

Cheers,