Skip to content

Commit

Permalink
Support for newer versions of Qt (commaai#31072)
Browse files Browse the repository at this point in the history
* Dynamic QtGui version

* Fixed use of undeclared identifier 'va_start'

* Fix for Qt deprecations

* Fix for dynamic QtGui version

* Update selfdrive/ui/SConscript

---------

Co-authored-by: Adeeb Shihadeh <[email protected]>
  • Loading branch information
andiradulescu and adeebshihadeh authored Jan 19, 2024
1 parent c907dd9 commit 28028ae
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
5 changes: 4 additions & 1 deletion SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -297,8 +297,11 @@ else:
qt_env['QTDIR'] = qt_install_prefix
qt_dirs = [
f"{qt_install_headers}",
f"{qt_install_headers}/QtGui/5.12.8/QtGui",
]

qt_gui_path = os.path.join(qt_install_headers, "QtGui")
qt_gui_dirs = [d for d in os.listdir(qt_gui_path) if os.path.isdir(os.path.join(qt_gui_path, d))]
qt_dirs += f"{qt_install_headers}/QtGui/{qt_gui_dirs[0]}/QtGui" if qt_gui_dirs else []
qt_dirs += [f"{qt_install_headers}/Qt{m}" for m in qt_modules]

qt_libs = [f"Qt5{m}" for m in qt_modules]
Expand Down
1 change: 1 addition & 0 deletions common/swaglog.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <string>

#include <zmq.h>
#include <stdarg.h>
#include "third_party/json11/json11.hpp"
#include "common/version.h"
#include "system/hardware/hw.h"
Expand Down
3 changes: 3 additions & 0 deletions selfdrive/ui/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ if arch == "Darwin":
del base_libs[base_libs.index('OpenCL')]
qt_env['FRAMEWORKS'] += ['OpenCL']

# FIXME: remove this once we're on 5.15 (24.04)
qt_env['CXXFLAGS'] += ["-Wno-deprecated-declarations"]

qt_util = qt_env.Library("qt_util", ["#selfdrive/ui/qt/api.cc", "#selfdrive/ui/qt/util.cc"], LIBS=base_libs)
widgets_src = ["ui.cc", "qt/widgets/input.cc", "qt/widgets/wifi.cc",
"qt/widgets/ssh_keys.cc", "qt/widgets/toggle.cc", "qt/widgets/controls.cc",
Expand Down

0 comments on commit 28028ae

Please sign in to comment.