diff options
| author | 2026-04-05 06:10:51 +1000 | |
|---|---|---|
| committer | 2026-04-05 06:10:51 +1000 | |
| commit | 551c10eba468ad6e5be3200a1bd246fa9731de16 (patch) | |
| tree | a38c40807f1dfd55b598415c1a437e81aff325f9 /scripts | |
| 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')
| -rw-r--r-- | scripts/genie.lua | 22 | ||||
| -rw-r--r-- | scripts/src/osd/modules.lua | 62 | ||||
| -rw-r--r-- | scripts/src/osd/sdl.lua | 2 | ||||
| -rw-r--r-- | scripts/src/osd/sdl3_cfg.lua | 2 | ||||
| -rw-r--r-- | scripts/src/osd/sdl_cfg.lua | 2 |
5 files changed, 34 insertions, 56 deletions
diff --git a/scripts/genie.lua b/scripts/genie.lua index fcc4680a56d..a11e84548dd 100644 --- a/scripts/genie.lua +++ b/scripts/genie.lua @@ -1012,8 +1012,8 @@ end local version = str_to_version(_OPTIONS["gcc_version"]) if string.find(_OPTIONS["gcc"], "clang") or string.find(_OPTIONS["gcc"], "asmjs") or string.find(_OPTIONS["gcc"], "android") then - if version < 70000 then - print("Clang version 7.0 or later needed") + if version < 130000 then + print("Clang version 13 or later needed") os.exit(-1) end buildoptions { @@ -1202,18 +1202,12 @@ configuration { "osx*" } } configuration { "mingw*" } - if _OPTIONS["osd"]=="sdl" then - linkoptions { - "-Wl,--start-group", - } - else - linkoptions { - "-static", - } - flags { - "LinkSupportCircularDependencies", - } - end + linkoptions { + "-static", + } + flags { + "LinkSupportCircularDependencies", + } links { "user32", "winmm", 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 diff --git a/scripts/src/osd/sdl.lua b/scripts/src/osd/sdl.lua index 814bb32eea3..a53b7fe858f 100644 --- a/scripts/src/osd/sdl.lua +++ b/scripts/src/osd/sdl.lua @@ -59,6 +59,8 @@ function maintargetosdoptions(_target,_subtarget) links { "SDL2main", "SDL2", + "imm32", + "version", } configuration { "vs*" } links { diff --git a/scripts/src/osd/sdl3_cfg.lua b/scripts/src/osd/sdl3_cfg.lua index b0195355d7c..7eace8f65f6 100644 --- a/scripts/src/osd/sdl3_cfg.lua +++ b/scripts/src/osd/sdl3_cfg.lua @@ -133,7 +133,7 @@ elseif _OPTIONS["targetos"]=="linux" then } else buildoptions { - backtick(pkgconfigcmd() .. " --cflags Qt5Widgets"), + "-I$(shell qmake6 -query QT_INSTALL_HEADERS)", } end elseif _OPTIONS["targetos"]=="macosx" then diff --git a/scripts/src/osd/sdl_cfg.lua b/scripts/src/osd/sdl_cfg.lua index 400a559862e..9efd4944cf2 100644 --- a/scripts/src/osd/sdl_cfg.lua +++ b/scripts/src/osd/sdl_cfg.lua @@ -142,7 +142,7 @@ elseif _OPTIONS["targetos"]=="linux" then } else buildoptions { - backtick(pkgconfigcmd() .. " --cflags Qt5Widgets"), + "-I$(shell qmake6 -query QT_INSTALL_HEADERS)", } end elseif _OPTIONS["targetos"]=="macosx" then |
