diff options
| author | 2026-04-05 06:10:51 +1000 | |
|---|---|---|
| committer | 2026-04-05 06:10:51 +1000 | |
| commit | 551c10eba468ad6e5be3200a1bd246fa9731de16 (patch) | |
| tree | a38c40807f1dfd55b598415c1a437e81aff325f9 /scripts/src/osd/modules.lua | |
| parent | c6cdeb1e4af49e3e7c4bc41f761e0e956097ee82 (diff) | |
Move build system adjusttment and fixes:
* Bumped minimum clang version to 13 - clang 12 is just too buggy.
* Assume Qt 6 will be used, dropped Qt 5 support.
* Fixed finding Qt headers on Fedora and hopefully other distros.
* Always use static SDL2 on Windows.
* debugger/qt/debuggerview.cpp: Fixed build with Qt < 6.6.
* imgtool/modules/vzdos.cpp: Fixed build with Linux GCC 11.
Diffstat (limited to 'scripts/src/osd/modules.lua')
| -rw-r--r-- | scripts/src/osd/modules.lua | 62 |
1 files changed, 22 insertions, 40 deletions
diff --git a/scripts/src/osd/modules.lua b/scripts/src/osd/modules.lua index aaaf8965ad0..e0a3025f9de 100644 --- a/scripts/src/osd/modules.lua +++ b/scripts/src/osd/modules.lua @@ -410,9 +410,9 @@ function qtdebuggerbuild() if _OPTIONS["QT_HOME"]~=nil then qt_host_libexecs = backtick(_OPTIONS["QT_HOME"] .. "/bin/qmake -query QT_HOST_LIBEXECS") else - qt_host_libexecs = backtick("qmake -query QT_HOST_LIBEXECS") + qt_host_libexecs = backtick("qmake6 -query QT_HOST_LIBEXECS") end - MOCTST = backtick(qt_host_libexecs .. "/moc --version") + local MOCTST = backtick(qt_host_libexecs .. "/moc --version") if MOCTST=='' then print("Qt's Meta Object Compiler (moc) wasn't found!") os.exit(1) @@ -438,15 +438,14 @@ function qtdebuggerbuild() MOC = _OPTIONS["QT_HOME"] .. "/bin/moc" end else - local MOCTST = backtick("which moc-qt5 2>/dev/null") - if MOCTST=='' then - MOCTST = backtick("which moc 2>/dev/null") - end + local qt_host_libexecs = backtick("qmake6 -query QT_HOST_LIBEXECS") + MOCTST = backtick(qt_host_libexecs .. "/moc --version 2>/dev/null") if MOCTST=='' then print("Qt's Meta Object Compiler (moc) wasn't found!") os.exit(1) + else + MOC = qt_host_libexecs .. "/moc" end - MOC = MOCTST end end @@ -467,7 +466,7 @@ function qtdebuggerbuild() if _OPTIONS["targetos"]=="windows" then configuration { "mingw*" } buildoptions { - "-I$(shell qmake -query QT_INSTALL_HEADERS)", + "-I$(shell qmake6 -query QT_INSTALL_HEADERS)", } configuration { } elseif _OPTIONS["targetos"]=="macosx" then @@ -481,7 +480,7 @@ function qtdebuggerbuild() } else buildoptions { - backtick(pkgconfigcmd() .. " --cflags Qt5Widgets"), + "-I$(shell qmake6 -query QT_INSTALL_HEADERS)", } end end @@ -529,7 +528,7 @@ function osdmodulestargetconf() if _OPTIONS["USE_QTDEBUG"]=="1" then if _OPTIONS["targetos"]=="windows" then linkoptions { - "-L$(shell qmake -query QT_INSTALL_LIBS)", + "-L$(shell qmake6 -query QT_INSTALL_LIBS)", } links { "Qt6Core.dll", @@ -537,47 +536,30 @@ function osdmodulestargetconf() "Qt6Widgets.dll", } elseif _OPTIONS["targetos"]=="macosx" then - local qt_version = str_to_version(backtick("qmake -query QT_VERSION")) linkoptions { "-F" .. backtick("qmake -query QT_INSTALL_LIBS"), } - if qt_version < 60000 then - links { - "Qt5Core.framework", - "Qt5Gui.framework", - "Qt5Widgets.framework", - } - else - links { - "QtCore.framework", - "QtGui.framework", - "QtWidgets.framework", - } - end + links { + "QtCore.framework", + "QtGui.framework", + "QtWidgets.framework", + } else if _OPTIONS["QT_HOME"]~=nil then - local qt_version = str_to_version(backtick(_OPTIONS["QT_HOME"] .. "/bin/qmake -query QT_VERSION")) linkoptions { "-L" .. backtick(_OPTIONS["QT_HOME"] .. "/bin/qmake -query QT_INSTALL_LIBS"), } - if qt_version < 60000 then - links { - "Qt5Core", - "Qt5Gui", - "Qt5Widgets", - } - else - links { - "Qt6Core", - "Qt6Gui", - "Qt6Widgets", - } end else - local str = backtick(pkgconfigcmd() .. " --libs Qt5Widgets") - addlibfromstring(str) - addoptionsfromstring(str) + linkoptions { + "-L$(shell qmake6 -query QT_INSTALL_LIBS)", + } end + links { + "Qt6Core", + "Qt6Gui", + "Qt6Widgets", + } end end |
