From dfca3fb648274f6787366b05bc83df55ab4d76e6 Mon Sep 17 00:00:00 2001 From: dtor Date: Sat, 14 Dec 2024 04:00:05 +0000 Subject: [PATCH] tooling: include qt5 via copts --- Dockerfile | 1 + examples/qt/BUILD | 27 +++++++++++++++++++-------- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index 07922ce..2226ff4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -29,6 +29,7 @@ RUN apt-get update && apt-get install -y \ libxcb-xkb1 \ libxcb-cursor0 \ locales \ + qtbase5-dev \ && apt-get clean RUN wget -qO - https://apt.llvm.org/llvm-snapshot.gpg.key | tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc \ diff --git a/examples/qt/BUILD b/examples/qt/BUILD index 5a703b4..09b0782 100644 --- a/examples/qt/BUILD +++ b/examples/qt/BUILD @@ -1,18 +1,29 @@ -load("@rules_qt//:qt.bzl", "qt_cc_binary", "qt_cc_library") - -qt_cc_library( +cc_library( name = "lib", srcs = ["hello.cpp"], - hdrs = ["hello.hpp"], - deps = [ - "@rules_qt//:qt_core", - "@rules_qt//:qt_widgets", + hdrs = [ + "hello.hpp", + ], + copts = [ + "-I/usr/include/x86_64-linux-gnu/qt5", + "-I/usr/include/x86_64-linux-gnu/qt5/QtWidgets", + "-I/usr/include/x86_64-linux-gnu/qt5/QtCore", + ], + linkopts = [ + "-lQt5Widgets", + "-lQt5Core", + "-lQt5Gui", ], ) -qt_cc_binary( +cc_binary( name = "bin", srcs = ["main.cpp"], + copts = [ + "-I/usr/include/x86_64-linux-gnu/qt5", + "-I/usr/include/x86_64-linux-gnu/qt5/QtWidgets", + "-I/usr/include/x86_64-linux-gnu/qt5/QtCore", + ], deps = [ ":lib", ],