From ce07c2570a9c4cdeee7301e6049fa24279c588b9 Mon Sep 17 00:00:00 2001 From: sayter Date: Mon, 22 Jan 2024 15:10:49 +0800 Subject: [PATCH 01/30] hack --- .gitignore | 1 + MODULE.bazel | 6 ++++++ qt_linux_x86_64.BUILD | 5 ++++- 3 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 MODULE.bazel diff --git a/.gitignore b/.gitignore index a32ed4b..641d828 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ bazel-* .vscode +*.bazel.lock diff --git a/MODULE.bazel b/MODULE.bazel new file mode 100644 index 0000000..00bb183 --- /dev/null +++ b/MODULE.bazel @@ -0,0 +1,6 @@ +############################################################################### +# Bazel now uses Bzlmod by default to manage external dependencies. +# Please consider migrating your external dependencies from WORKSPACE to MODULE.bazel. +# +# For more details, please check https://github.com/bazelbuild/bazel/issues/18958 +############################################################################### diff --git a/qt_linux_x86_64.BUILD b/qt_linux_x86_64.BUILD index c7a003d..7b8c1fc 100644 --- a/qt_linux_x86_64.BUILD +++ b/qt_linux_x86_64.BUILD @@ -20,7 +20,10 @@ load("@rules_qt//:qt_libraries.bzl", "QT_LIBRARIES") cc_library( name = "qt_hdrs", - hdrs = glob(["include/**"]), + hdrs = glob([ + "include/**", + "include/QtCore/6.4.0/QtCore/private/**", + ]), includes = [ "include", ], From fe29f012df69e77fae4091c88b96d5515c86125e Mon Sep 17 00:00:00 2001 From: sayter Date: Mon, 22 Jan 2024 15:16:16 +0800 Subject: [PATCH 02/30] hack --- qt_linux_x86_64.BUILD | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/qt_linux_x86_64.BUILD b/qt_linux_x86_64.BUILD index 7b8c1fc..6d539fd 100644 --- a/qt_linux_x86_64.BUILD +++ b/qt_linux_x86_64.BUILD @@ -7,7 +7,10 @@ load("@rules_qt//:qt_libraries.bzl", "QT_LIBRARIES") "lib/lib%s.so*" % library_name, "lib/libicu*.so*", ]), - hdrs = glob(["include/%s/**" % include_folder]), + hdrs = glob([ + "include/%s/**" % include_folder, + "include/QtCore/6.4.0/QtCore/private/**", + ]), includes = [ "include", "include/%s" % include_folder, @@ -20,10 +23,7 @@ load("@rules_qt//:qt_libraries.bzl", "QT_LIBRARIES") cc_library( name = "qt_hdrs", - hdrs = glob([ - "include/**", - "include/QtCore/6.4.0/QtCore/private/**", - ]), + hdrs = glob(["include/**"]), includes = [ "include", ], From 00e0ec3f99c20768eed2617a70d1080a875a5d37 Mon Sep 17 00:00:00 2001 From: sayter Date: Mon, 22 Jan 2024 15:17:20 +0800 Subject: [PATCH 03/30] hack --- qt_linux_x86_64.BUILD | 1 + 1 file changed, 1 insertion(+) diff --git a/qt_linux_x86_64.BUILD b/qt_linux_x86_64.BUILD index 6d539fd..0260455 100644 --- a/qt_linux_x86_64.BUILD +++ b/qt_linux_x86_64.BUILD @@ -14,6 +14,7 @@ load("@rules_qt//:qt_libraries.bzl", "QT_LIBRARIES") includes = [ "include", "include/%s" % include_folder, + "include/QtCore/6.4.0/QtCore/private/**", ], target_compatible_with = ["@platforms//os:linux"], visibility = ["//visibility:public"], From 2c7a3337aa758194933a2a5a97d653ee0462f95a Mon Sep 17 00:00:00 2001 From: sayter Date: Mon, 22 Jan 2024 15:19:29 +0800 Subject: [PATCH 04/30] hack --- qt_linux_x86_64.BUILD | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/qt_linux_x86_64.BUILD b/qt_linux_x86_64.BUILD index 0260455..35cd983 100644 --- a/qt_linux_x86_64.BUILD +++ b/qt_linux_x86_64.BUILD @@ -24,9 +24,13 @@ load("@rules_qt//:qt_libraries.bzl", "QT_LIBRARIES") cc_library( name = "qt_hdrs", - hdrs = glob(["include/**"]), + hdrs = glob([ + "include/**", + "include/QtCore/6.4.0/QtCore/private/**", + ]), includes = [ "include", + "include/QtCore/6.4.0/QtCore/private/**", ], visibility = ["//visibility:public"], ) From 4c0732cc1a93116bcda10dce17e96caad9f1a66d Mon Sep 17 00:00:00 2001 From: sayter Date: Mon, 22 Jan 2024 16:41:02 +0800 Subject: [PATCH 05/30] prebuilt --- .gitattributes | 1 + prebuilt/qt_6.4.3_linux_desktop_gcc_64.tar.xz | 3 +++ qt_linux_x86_64.BUILD | 4 ---- 3 files changed, 4 insertions(+), 4 deletions(-) create mode 100644 prebuilt/qt_6.4.3_linux_desktop_gcc_64.tar.xz diff --git a/.gitattributes b/.gitattributes index 53c21a0..cb82c22 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,2 +1,3 @@ # https://www.aleksandrhovhannisyan.com/blog/crlf-vs-lf-normalizing-line-endings-in-git/ * text=auto +prebuilt/qt_6.4.3_linux_desktop_gcc_64.tar.xz filter=lfs diff=lfs merge=lfs -text diff --git a/prebuilt/qt_6.4.3_linux_desktop_gcc_64.tar.xz b/prebuilt/qt_6.4.3_linux_desktop_gcc_64.tar.xz new file mode 100644 index 0000000..c66c9ae --- /dev/null +++ b/prebuilt/qt_6.4.3_linux_desktop_gcc_64.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:17e5ae1d6814d85db7506ccac15e61753e768679fdfd756c1cc2d420082ab3a5 +size 28664964 diff --git a/qt_linux_x86_64.BUILD b/qt_linux_x86_64.BUILD index 35cd983..8b9c996 100644 --- a/qt_linux_x86_64.BUILD +++ b/qt_linux_x86_64.BUILD @@ -9,12 +9,10 @@ load("@rules_qt//:qt_libraries.bzl", "QT_LIBRARIES") ]), hdrs = glob([ "include/%s/**" % include_folder, - "include/QtCore/6.4.0/QtCore/private/**", ]), includes = [ "include", "include/%s" % include_folder, - "include/QtCore/6.4.0/QtCore/private/**", ], target_compatible_with = ["@platforms//os:linux"], visibility = ["//visibility:public"], @@ -26,11 +24,9 @@ cc_library( name = "qt_hdrs", hdrs = glob([ "include/**", - "include/QtCore/6.4.0/QtCore/private/**", ]), includes = [ "include", - "include/QtCore/6.4.0/QtCore/private/**", ], visibility = ["//visibility:public"], ) From 5669a90fbcf6ef5999a6c43ee3f86b2ac34112b3 Mon Sep 17 00:00:00 2001 From: sayter Date: Mon, 22 Jan 2024 16:47:27 +0800 Subject: [PATCH 06/30] update source --- fetch_qt.bzl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fetch_qt.bzl b/fetch_qt.bzl index 263672b..4487e3d 100644 --- a/fetch_qt.bzl +++ b/fetch_qt.bzl @@ -25,10 +25,10 @@ def fetch_qt6(): http_archive( name = "qt_linux_x86_64", urls = [ - "https://vertexwahn.de/lfs/v1/qt_6.4.0_linux_desktop_gcc_64.tar.xz", + "https://github.com/Sayter99/rules_qt6/blob/main/prebuilt/qt_6.4.3_linux_desktop_gcc_64.tar.xz", ], - sha256 = "809919895e2ac0567df9290676d4ec6cd1ed39c432dc5da0722b3104681fd376", - strip_prefix = "6.4.0/gcc_64", + sha256 = "17e5ae1d6814d85db7506ccac15e61753e768679fdfd756c1cc2d420082ab3a5", + strip_prefix = "6.4.3/gcc_64", build_file = "@rules_qt//:qt_linux_x86_64.BUILD", ) From a0f678108eedb0a5066525a7d5d47112b0928bc7 Mon Sep 17 00:00:00 2001 From: sayter Date: Mon, 22 Jan 2024 16:49:02 +0800 Subject: [PATCH 07/30] update --- fetch_qt.bzl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fetch_qt.bzl b/fetch_qt.bzl index 4487e3d..3214d5d 100644 --- a/fetch_qt.bzl +++ b/fetch_qt.bzl @@ -27,7 +27,7 @@ def fetch_qt6(): urls = [ "https://github.com/Sayter99/rules_qt6/blob/main/prebuilt/qt_6.4.3_linux_desktop_gcc_64.tar.xz", ], - sha256 = "17e5ae1d6814d85db7506ccac15e61753e768679fdfd756c1cc2d420082ab3a5", + sha256 = "f095bd0d15df1207c974ca671fd3fe801308b64a7eaced8a9bc748900d6b6e94", strip_prefix = "6.4.3/gcc_64", build_file = "@rules_qt//:qt_linux_x86_64.BUILD", ) From 36ff6a7dbbdf3185002474cd5c85e950f7be9898 Mon Sep 17 00:00:00 2001 From: sayter Date: Tue, 23 Jan 2024 08:25:16 +0800 Subject: [PATCH 08/30] update prebuilt --- .gitattributes | 1 + fetch_qt.bzl | 6 +++--- prebuilt/qt_6.4.3_linux_desktop_gcc_64.tar.xz | 3 --- prebuilt/qt_6.5.3_linux_desktop_gcc_64.zip | 3 +++ 4 files changed, 7 insertions(+), 6 deletions(-) delete mode 100644 prebuilt/qt_6.4.3_linux_desktop_gcc_64.tar.xz create mode 100644 prebuilt/qt_6.5.3_linux_desktop_gcc_64.zip diff --git a/.gitattributes b/.gitattributes index cb82c22..8ed35f8 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,3 +1,4 @@ # https://www.aleksandrhovhannisyan.com/blog/crlf-vs-lf-normalizing-line-endings-in-git/ * text=auto prebuilt/qt_6.4.3_linux_desktop_gcc_64.tar.xz filter=lfs diff=lfs merge=lfs -text +prebuilt/qt_6.5.3_linux_desktop_gcc_64.zip filter=lfs diff=lfs merge=lfs -text diff --git a/fetch_qt.bzl b/fetch_qt.bzl index 3214d5d..8c9ee1c 100644 --- a/fetch_qt.bzl +++ b/fetch_qt.bzl @@ -25,10 +25,10 @@ def fetch_qt6(): http_archive( name = "qt_linux_x86_64", urls = [ - "https://github.com/Sayter99/rules_qt6/blob/main/prebuilt/qt_6.4.3_linux_desktop_gcc_64.tar.xz", + "https://github.com/Sayter99/rules_qt6/blob/main/prebuilt/qt_6.5.3_linux_desktop_gcc_64.zip", ], - sha256 = "f095bd0d15df1207c974ca671fd3fe801308b64a7eaced8a9bc748900d6b6e94", - strip_prefix = "6.4.3/gcc_64", + sha256 = "e283eb2ca8e9eb65aeeae4a6e18395705e68637e7f543ea40ce47ce52ce7415a", + strip_prefix = "6.5.3/gcc_64", build_file = "@rules_qt//:qt_linux_x86_64.BUILD", ) diff --git a/prebuilt/qt_6.4.3_linux_desktop_gcc_64.tar.xz b/prebuilt/qt_6.4.3_linux_desktop_gcc_64.tar.xz deleted file mode 100644 index c66c9ae..0000000 --- a/prebuilt/qt_6.4.3_linux_desktop_gcc_64.tar.xz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:17e5ae1d6814d85db7506ccac15e61753e768679fdfd756c1cc2d420082ab3a5 -size 28664964 diff --git a/prebuilt/qt_6.5.3_linux_desktop_gcc_64.zip b/prebuilt/qt_6.5.3_linux_desktop_gcc_64.zip new file mode 100644 index 0000000..178e62e --- /dev/null +++ b/prebuilt/qt_6.5.3_linux_desktop_gcc_64.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e283eb2ca8e9eb65aeeae4a6e18395705e68637e7f543ea40ce47ce52ce7415a +size 112554979 From e39d6857ee7816a3aef766ab869db8c5a627ad18 Mon Sep 17 00:00:00 2001 From: sayter Date: Tue, 23 Jan 2024 08:27:24 +0800 Subject: [PATCH 09/30] update attributes --- .gitattributes | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitattributes b/.gitattributes index 8ed35f8..8c955e2 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,4 +1,3 @@ # https://www.aleksandrhovhannisyan.com/blog/crlf-vs-lf-normalizing-line-endings-in-git/ * text=auto -prebuilt/qt_6.4.3_linux_desktop_gcc_64.tar.xz filter=lfs diff=lfs merge=lfs -text prebuilt/qt_6.5.3_linux_desktop_gcc_64.zip filter=lfs diff=lfs merge=lfs -text From d9a10b0835b11e13825ad6d0d9fd7f5405e007a9 Mon Sep 17 00:00:00 2001 From: sayter Date: Tue, 23 Jan 2024 08:45:23 +0800 Subject: [PATCH 10/30] fix --- fetch_qt.bzl | 4 ++-- tests/.bazelversion | 2 +- tests/MODULE.bazel | 6 ++++++ tests/hello_world/BUILD.bazel | 3 +++ 4 files changed, 12 insertions(+), 3 deletions(-) create mode 100644 tests/MODULE.bazel diff --git a/fetch_qt.bzl b/fetch_qt.bzl index 8c9ee1c..e76de21 100644 --- a/fetch_qt.bzl +++ b/fetch_qt.bzl @@ -25,10 +25,10 @@ def fetch_qt6(): http_archive( name = "qt_linux_x86_64", urls = [ - "https://github.com/Sayter99/rules_qt6/blob/main/prebuilt/qt_6.5.3_linux_desktop_gcc_64.zip", + "https://github.com/Sayter99/rules_qt6/raw/main/prebuilt/qt_6.5.3_linux_desktop_gcc_64.zip?download=", ], sha256 = "e283eb2ca8e9eb65aeeae4a6e18395705e68637e7f543ea40ce47ce52ce7415a", - strip_prefix = "6.5.3/gcc_64", + strip_prefix = "qt_6.5.3_linux_desktop_gcc_64/6.5.3/gcc_64", build_file = "@rules_qt//:qt_linux_x86_64.BUILD", ) diff --git a/tests/.bazelversion b/tests/.bazelversion index 91e4a9f..66ce77b 100644 --- a/tests/.bazelversion +++ b/tests/.bazelversion @@ -1 +1 @@ -6.3.2 +7.0.0 diff --git a/tests/MODULE.bazel b/tests/MODULE.bazel new file mode 100644 index 0000000..00bb183 --- /dev/null +++ b/tests/MODULE.bazel @@ -0,0 +1,6 @@ +############################################################################### +# Bazel now uses Bzlmod by default to manage external dependencies. +# Please consider migrating your external dependencies from WORKSPACE to MODULE.bazel. +# +# For more details, please check https://github.com/bazelbuild/bazel/issues/18958 +############################################################################### diff --git a/tests/hello_world/BUILD.bazel b/tests/hello_world/BUILD.bazel index d18c054..f9a2b55 100644 --- a/tests/hello_world/BUILD.bazel +++ b/tests/hello_world/BUILD.bazel @@ -7,4 +7,7 @@ qt_cc_binary( "@rules_qt//:qt_core", "@rules_qt//:qt_widgets", ], + copts = [ + "-std=c++17", + ], ) From 244a05b103d72848b7e2827283e04b6cfc605dc5 Mon Sep 17 00:00:00 2001 From: sayter Date: Tue, 23 Jan 2024 10:32:01 +0800 Subject: [PATCH 11/30] 6.5.1 --- .gitattributes | 2 +- fetch_qt.bzl | 6 +++--- prebuilt/qt_6.5.1_linux_desktop_gcc_64.zip | 3 +++ prebuilt/qt_6.5.3_linux_desktop_gcc_64.zip | 3 --- 4 files changed, 7 insertions(+), 7 deletions(-) create mode 100644 prebuilt/qt_6.5.1_linux_desktop_gcc_64.zip delete mode 100644 prebuilt/qt_6.5.3_linux_desktop_gcc_64.zip diff --git a/.gitattributes b/.gitattributes index 8c955e2..137c818 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,3 +1,3 @@ # https://www.aleksandrhovhannisyan.com/blog/crlf-vs-lf-normalizing-line-endings-in-git/ * text=auto -prebuilt/qt_6.5.3_linux_desktop_gcc_64.zip filter=lfs diff=lfs merge=lfs -text +prebuilt/qt_6.5.1_linux_desktop_gcc_64.zip filter=lfs diff=lfs merge=lfs -text diff --git a/fetch_qt.bzl b/fetch_qt.bzl index e76de21..0ce56bd 100644 --- a/fetch_qt.bzl +++ b/fetch_qt.bzl @@ -25,10 +25,10 @@ def fetch_qt6(): http_archive( name = "qt_linux_x86_64", urls = [ - "https://github.com/Sayter99/rules_qt6/raw/main/prebuilt/qt_6.5.3_linux_desktop_gcc_64.zip?download=", + "https://github.com/Sayter99/rules_qt6/raw/main/prebuilt/qt_6.5.1_linux_desktop_gcc_64.zip?download=", ], - sha256 = "e283eb2ca8e9eb65aeeae4a6e18395705e68637e7f543ea40ce47ce52ce7415a", - strip_prefix = "qt_6.5.3_linux_desktop_gcc_64/6.5.3/gcc_64", + sha256 = "43e11369e6639244028fbb7e7e13480a6c6044f6879de24da672c083a0680424", + strip_prefix = "6.5.1/gcc_64", build_file = "@rules_qt//:qt_linux_x86_64.BUILD", ) diff --git a/prebuilt/qt_6.5.1_linux_desktop_gcc_64.zip b/prebuilt/qt_6.5.1_linux_desktop_gcc_64.zip new file mode 100644 index 0000000..f27d62a --- /dev/null +++ b/prebuilt/qt_6.5.1_linux_desktop_gcc_64.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:43e11369e6639244028fbb7e7e13480a6c6044f6879de24da672c083a0680424 +size 111952223 diff --git a/prebuilt/qt_6.5.3_linux_desktop_gcc_64.zip b/prebuilt/qt_6.5.3_linux_desktop_gcc_64.zip deleted file mode 100644 index 178e62e..0000000 --- a/prebuilt/qt_6.5.3_linux_desktop_gcc_64.zip +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:e283eb2ca8e9eb65aeeae4a6e18395705e68637e7f543ea40ce47ce52ce7415a -size 112554979 From 5cf73aa3ca2a378d7e78b31f37b64efd583969a3 Mon Sep 17 00:00:00 2001 From: sayter Date: Thu, 25 Jan 2024 10:59:21 +0800 Subject: [PATCH 12/30] change file hosting service --- .gitattributes | 1 - fetch_qt.bzl | 2 +- prebuilt/qt_6.5.1_linux_desktop_gcc_64.zip | 3 --- tests/.bazelversion | 1 - 4 files changed, 1 insertion(+), 6 deletions(-) delete mode 100644 prebuilt/qt_6.5.1_linux_desktop_gcc_64.zip delete mode 100644 tests/.bazelversion diff --git a/.gitattributes b/.gitattributes index 137c818..53c21a0 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,3 +1,2 @@ # https://www.aleksandrhovhannisyan.com/blog/crlf-vs-lf-normalizing-line-endings-in-git/ * text=auto -prebuilt/qt_6.5.1_linux_desktop_gcc_64.zip filter=lfs diff=lfs merge=lfs -text diff --git a/fetch_qt.bzl b/fetch_qt.bzl index 0ce56bd..741bb2c 100644 --- a/fetch_qt.bzl +++ b/fetch_qt.bzl @@ -25,7 +25,7 @@ def fetch_qt6(): http_archive( name = "qt_linux_x86_64", urls = [ - "https://github.com/Sayter99/rules_qt6/raw/main/prebuilt/qt_6.5.1_linux_desktop_gcc_64.zip?download=", + "https://dl.dropboxusercontent.com/scl/fi/1oscofwpr6kg0esb3ud9v/qt_6.5.1_linux_desktop_gcc_64.zip?rlkey=tmof818pcx8jl5lk2wznaowcs&dl=0", ], sha256 = "43e11369e6639244028fbb7e7e13480a6c6044f6879de24da672c083a0680424", strip_prefix = "6.5.1/gcc_64", diff --git a/prebuilt/qt_6.5.1_linux_desktop_gcc_64.zip b/prebuilt/qt_6.5.1_linux_desktop_gcc_64.zip deleted file mode 100644 index f27d62a..0000000 --- a/prebuilt/qt_6.5.1_linux_desktop_gcc_64.zip +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:43e11369e6639244028fbb7e7e13480a6c6044f6879de24da672c083a0680424 -size 111952223 diff --git a/tests/.bazelversion b/tests/.bazelversion deleted file mode 100644 index 66ce77b..0000000 --- a/tests/.bazelversion +++ /dev/null @@ -1 +0,0 @@ -7.0.0 From 0062a1f4bcbca3789719fd3966d4fe848ddd3554 Mon Sep 17 00:00:00 2001 From: sayter Date: Sun, 28 Jan 2024 08:14:54 +0800 Subject: [PATCH 13/30] win 6.5.1 --- fetch_qt.bzl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fetch_qt.bzl b/fetch_qt.bzl index 741bb2c..da9d2f1 100644 --- a/fetch_qt.bzl +++ b/fetch_qt.bzl @@ -9,10 +9,10 @@ def fetch_qt6(): http_archive( name = "qt_windows_x86_64", urls = [ - "https://vertexwahn.de/lfs/v1/qt_6.4.0_windows_desktop_win64_msvc2019_64.zip", + "https://dl.dropboxusercontent.com/scl/fi/hmttghb2k57vsacyyac9h/qt_6.5.1_windows_x64_msvc2022.zip?rlkey=b78l2th4cibc6z22lugswo34e&dl=0", ], - sha256 = "e3c20b441ddd8bb803e46de32bf2fc5563fda125409d62dcd12b5647ae5a9c7e", - strip_prefix = "6.4.0/msvc2019_64", + sha256 = "c9fa6ff6b4956aef8a83dd9bc0b9f9ba954c79fbaef13d14299a75f4dfae83e6", + strip_prefix = "6.5.1/msvc2022_64", build_file = "@rules_qt//:qt_windows_x86_64.BUILD", ) From b22d4e1ecd4cdd8d26e6659e15f63a976270befe Mon Sep 17 00:00:00 2001 From: sayter Date: Sun, 28 Jan 2024 14:21:11 +0800 Subject: [PATCH 14/30] release mode --- fetch_qt.bzl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fetch_qt.bzl b/fetch_qt.bzl index da9d2f1..07d041b 100644 --- a/fetch_qt.bzl +++ b/fetch_qt.bzl @@ -9,9 +9,9 @@ def fetch_qt6(): http_archive( name = "qt_windows_x86_64", urls = [ - "https://dl.dropboxusercontent.com/scl/fi/hmttghb2k57vsacyyac9h/qt_6.5.1_windows_x64_msvc2022.zip?rlkey=b78l2th4cibc6z22lugswo34e&dl=0", + "https://dl.dropboxusercontent.com/scl/fi/n1jdu41re9vla3h9y7kcf/qt_6.5.1_windows_msvc2022_64.zip?rlkey=sxuwub1oiabvansud311ynpyi&dl=0", ], - sha256 = "c9fa6ff6b4956aef8a83dd9bc0b9f9ba954c79fbaef13d14299a75f4dfae83e6", + sha256 = "8e4c34e2ef1c62cedef9674433b1d4bc479fcf16b5394403379072d2b3b3d2de", strip_prefix = "6.5.1/msvc2022_64", build_file = "@rules_qt//:qt_windows_x86_64.BUILD", ) From 21c3d7efabdf2693f251e8da303e2d3bdf52a952 Mon Sep 17 00:00:00 2001 From: sayter Date: Mon, 29 Jan 2024 18:35:53 +0800 Subject: [PATCH 15/30] webengine --- fetch_qt.bzl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fetch_qt.bzl b/fetch_qt.bzl index 07d041b..f78beac 100644 --- a/fetch_qt.bzl +++ b/fetch_qt.bzl @@ -9,9 +9,9 @@ def fetch_qt6(): http_archive( name = "qt_windows_x86_64", urls = [ - "https://dl.dropboxusercontent.com/scl/fi/n1jdu41re9vla3h9y7kcf/qt_6.5.1_windows_msvc2022_64.zip?rlkey=sxuwub1oiabvansud311ynpyi&dl=0", + "https://dl.dropboxusercontent.com/scl/fi/s96ot2qirkjqx3g5nctds/qt_6.5.1_windows_msvc2022_64.zip?rlkey=qq7cswbhtxcxg88emfyzb2s1k&dl=0", ], - sha256 = "8e4c34e2ef1c62cedef9674433b1d4bc479fcf16b5394403379072d2b3b3d2de", + sha256 = "3e96d38afe95d32794fc98459379c063bb9f027379843b3d42ab58c68428e0e5", strip_prefix = "6.5.1/msvc2022_64", build_file = "@rules_qt//:qt_windows_x86_64.BUILD", ) From eedbf3592d552426ce50486229938eb0ae0d66f1 Mon Sep 17 00:00:00 2001 From: sayter Date: Mon, 29 Jan 2024 18:37:55 +0800 Subject: [PATCH 16/30] simplified CI --- .github/workflows/bazel_build.yml | 162 +++++++++++++++--------------- 1 file changed, 81 insertions(+), 81 deletions(-) diff --git a/.github/workflows/bazel_build.yml b/.github/workflows/bazel_build.yml index 6cdad07..c36a295 100644 --- a/.github/workflows/bazel_build.yml +++ b/.github/workflows/bazel_build.yml @@ -5,23 +5,23 @@ on: push: {} jobs: - build_and_test_ubuntu20: - name: Linux Ubuntu 20.04 build - runs-on: ubuntu-20.04 + # build_and_test_ubuntu20: + # name: Linux Ubuntu 20.04 build + # runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v3 + # steps: + # - uses: actions/checkout@v3 - - name: Mount bazel cache - uses: actions/cache@v3 - with: - path: "/home/runner/.cache/bazel" - key: bazel + # - name: Mount bazel cache + # uses: actions/cache@v3 + # with: + # path: "/home/runner/.cache/bazel" + # key: bazel - - name: Build - run: | - cd tests - bazelisk build --config=gcc9 //... + # - name: Build + # run: | + # cd tests + # bazelisk build --config=gcc9 //... build_and_test_ubuntu22: name: Linux Ubuntu 22.04 build @@ -41,23 +41,23 @@ jobs: cd tests bazelisk build --config=gcc11 //... - build_and_test_windows10: - name: Windows Server 2019 build - runs-on: windows-2019 + # build_and_test_windows10: + # name: Windows Server 2019 build + # runs-on: windows-2019 - steps: - - uses: actions/checkout@v3 + # steps: + # - uses: actions/checkout@v3 - - name: Mount bazel cache - uses: actions/cache@v3 - with: - path: "/home/runner/.cache/bazel" - key: bazel + # - name: Mount bazel cache + # uses: actions/cache@v3 + # with: + # path: "/home/runner/.cache/bazel" + # key: bazel - - name: Build - run: | - cd tests - bazelisk build --config=vs2019 //... + # - name: Build + # run: | + # cd tests + # bazelisk build --config=vs2019 //... build_and_test_windows11: name: Windows Server 2022 build @@ -77,61 +77,61 @@ jobs: cd tests bazelisk build --config=vs2022 //... - build_and_test_macos11: - name: macOS 11 Bazel build - runs-on: macOS-11 - - steps: - - uses: actions/checkout@v3 - - - name: Mount bazel cache - uses: actions/cache@v3 - with: - path: "/home/runner/.cache/bazel" - key: bazel - - - name: Print info - run: | - echo "OS info:" - sw_vers - uname - echo "Compiler info:" - clang --version + # build_and_test_macos11: + # name: macOS 11 Bazel build + # runs-on: macOS-11 + + # steps: + # - uses: actions/checkout@v3 + + # - name: Mount bazel cache + # uses: actions/cache@v3 + # with: + # path: "/home/runner/.cache/bazel" + # key: bazel + + # - name: Print info + # run: | + # echo "OS info:" + # sw_vers + # uname + # echo "Compiler info:" + # clang --version - - name: Build - run: | - brew install qt@6 - #brew link qt@6 - cd tests - bazelisk build --config=macos //... - - build_and_test_macos12: - name: macOS 12 Bazel build - runs-on: macOS-12 - - steps: - - uses: actions/checkout@v3 - - - name: Mount bazel cache - uses: actions/cache@v3 - with: - path: "/home/runner/.cache/bazel" - key: bazel - - - name: Print info - run: | - echo "OS info:" - sw_vers - uname - echo "Compiler info:" - clang --version + # - name: Build + # run: | + # brew install qt@6 + # #brew link qt@6 + # cd tests + # bazelisk build --config=macos //... + + # build_and_test_macos12: + # name: macOS 12 Bazel build + # runs-on: macOS-12 + + # steps: + # - uses: actions/checkout@v3 + + # - name: Mount bazel cache + # uses: actions/cache@v3 + # with: + # path: "/home/runner/.cache/bazel" + # key: bazel + + # - name: Print info + # run: | + # echo "OS info:" + # sw_vers + # uname + # echo "Compiler info:" + # clang --version - - name: Build - run: | - brew install qt@6 - #brew link qt@6 - cd tests - bazelisk build --config=macos //... + # - name: Build + # run: | + # brew install qt@6 + # #brew link qt@6 + # cd tests + # bazelisk build --config=macos //... build_and_test_macos13: name: macOS 13 Bazel build From 757259e10b211dbf67e6acb2740153a7626c07f3 Mon Sep 17 00:00:00 2001 From: sayter Date: Thu, 29 Feb 2024 00:57:34 +0800 Subject: [PATCH 17/30] include googlemap --- fetch_qt.bzl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fetch_qt.bzl b/fetch_qt.bzl index f78beac..f63182a 100644 --- a/fetch_qt.bzl +++ b/fetch_qt.bzl @@ -27,7 +27,7 @@ def fetch_qt6(): urls = [ "https://dl.dropboxusercontent.com/scl/fi/1oscofwpr6kg0esb3ud9v/qt_6.5.1_linux_desktop_gcc_64.zip?rlkey=tmof818pcx8jl5lk2wznaowcs&dl=0", ], - sha256 = "43e11369e6639244028fbb7e7e13480a6c6044f6879de24da672c083a0680424", + sha256 = "cd7a0190390d2ca68b5c06ac95d36af22836993233565acf2ec73b0f74d7c914", strip_prefix = "6.5.1/gcc_64", build_file = "@rules_qt//:qt_linux_x86_64.BUILD", ) From a0132b5f5754b27576179d929d169559de777c80 Mon Sep 17 00:00:00 2001 From: sayter Date: Thu, 29 Feb 2024 01:08:08 +0800 Subject: [PATCH 18/30] fix link --- fetch_qt.bzl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fetch_qt.bzl b/fetch_qt.bzl index f63182a..0368c78 100644 --- a/fetch_qt.bzl +++ b/fetch_qt.bzl @@ -25,7 +25,7 @@ def fetch_qt6(): http_archive( name = "qt_linux_x86_64", urls = [ - "https://dl.dropboxusercontent.com/scl/fi/1oscofwpr6kg0esb3ud9v/qt_6.5.1_linux_desktop_gcc_64.zip?rlkey=tmof818pcx8jl5lk2wznaowcs&dl=0", + "https://dl.dropboxusercontent.com/scl/fi/sjwx30o914oxm4rdxrkas/qt_6.5.1_linux_desktop_gcc_64.zip?rlkey=xulfkmvkrj9mdfbkv5928sjjk&dl=0", ], sha256 = "cd7a0190390d2ca68b5c06ac95d36af22836993233565acf2ec73b0f74d7c914", strip_prefix = "6.5.1/gcc_64", From c79177dfa0349a21b4c367996b130df312abea0d Mon Sep 17 00:00:00 2001 From: sayter Date: Thu, 29 Feb 2024 01:51:32 +0800 Subject: [PATCH 19/30] update win --- fetch_qt.bzl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fetch_qt.bzl b/fetch_qt.bzl index 0368c78..4947425 100644 --- a/fetch_qt.bzl +++ b/fetch_qt.bzl @@ -9,9 +9,9 @@ def fetch_qt6(): http_archive( name = "qt_windows_x86_64", urls = [ - "https://dl.dropboxusercontent.com/scl/fi/s96ot2qirkjqx3g5nctds/qt_6.5.1_windows_msvc2022_64.zip?rlkey=qq7cswbhtxcxg88emfyzb2s1k&dl=0", + "https://dl.dropboxusercontent.com/scl/fi/bs40xpt0wuge3hgv49k6o/qt_6.5.1_windows_msvc2022_64.zip?rlkey=7tau52rp4ilksnuh6659i3zxn&dl=0", ], - sha256 = "3e96d38afe95d32794fc98459379c063bb9f027379843b3d42ab58c68428e0e5", + sha256 = "87c8971f183ea0e82d5149c4d86c8cab1419272ed8301044d088bed38b9e0322", strip_prefix = "6.5.1/msvc2022_64", build_file = "@rules_qt//:qt_windows_x86_64.BUILD", ) From 6fc57ca8061b7e79ce24673b9aeb8d87f10f1ff7 Mon Sep 17 00:00:00 2001 From: sayter Date: Sat, 2 Mar 2024 13:10:17 +0800 Subject: [PATCH 20/30] try 6.5.3 for windows --- fetch_qt.bzl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fetch_qt.bzl b/fetch_qt.bzl index 4947425..0adf654 100644 --- a/fetch_qt.bzl +++ b/fetch_qt.bzl @@ -9,10 +9,10 @@ def fetch_qt6(): http_archive( name = "qt_windows_x86_64", urls = [ - "https://dl.dropboxusercontent.com/scl/fi/bs40xpt0wuge3hgv49k6o/qt_6.5.1_windows_msvc2022_64.zip?rlkey=7tau52rp4ilksnuh6659i3zxn&dl=0", + "https://dl.dropboxusercontent.com/scl/fi/z00b2gu5gtuiqrbg3w2ew/qt_6.5.3_windows_msvc2022_64.zip?rlkey=sfnbnx4md9fms5o7mmpe1lqlg&dl=0", ], - sha256 = "87c8971f183ea0e82d5149c4d86c8cab1419272ed8301044d088bed38b9e0322", - strip_prefix = "6.5.1/msvc2022_64", + sha256 = "74e5d4e5dccad28d7e32cd4f9ea659b22143c4dca2dfb4eb98cc0c06372efe35", + strip_prefix = "6.5.3/msvc2022_64", build_file = "@rules_qt//:qt_windows_x86_64.BUILD", ) From afc3a54b659b159ccefc401ee6eb6d0f3161560c Mon Sep 17 00:00:00 2001 From: sayter Date: Fri, 31 May 2024 20:55:31 +0800 Subject: [PATCH 21/30] moc as textual_hdrs --- qt.bzl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/qt.bzl b/qt.bzl index 1ae71c0..d8bf7a8 100644 --- a/qt.bzl +++ b/qt.bzl @@ -232,7 +232,7 @@ def qt_cc_library(name, srcs, hdrs, normal_hdrs = [], deps = None, copts = [], t _moc_srcs = [] for hdr in hdrs: header_path = "%s/%s" % (native.package_name(), hdr) if len(native.package_name()) > 0 else hdr - moc_name = "%s_moc" % hdr.replace(".", "_") + moc_name = "moc_%s" % hdr.rsplit(".", 1)[0] native.genrule( name = moc_name, srcs = [hdr], @@ -256,6 +256,7 @@ def qt_cc_library(name, srcs, hdrs, normal_hdrs = [], deps = None, copts = [], t name = name, srcs = srcs + _moc_srcs, hdrs = hdrs + normal_hdrs, + textual_hdrs = _moc_srcs, deps = deps, copts = copts + select({ "@platforms//os:windows": [], From b538d23584a1a660c9d01c9025c7c95f1f529768 Mon Sep 17 00:00:00 2001 From: sayter Date: Fri, 31 May 2024 20:59:15 +0800 Subject: [PATCH 22/30] moc suffix -> cpp --- qt.bzl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qt.bzl b/qt.bzl index d8bf7a8..f7db0ae 100644 --- a/qt.bzl +++ b/qt.bzl @@ -236,7 +236,7 @@ def qt_cc_library(name, srcs, hdrs, normal_hdrs = [], deps = None, copts = [], t native.genrule( name = moc_name, srcs = [hdr], - outs = [moc_name + ".cc"], + outs = [moc_name + ".cpp"], cmd = select({ "@platforms//os:linux": "$(location @qt_linux_x86_64//:moc) $(locations %s) -o $@ -f'%s'" % (hdr, header_path), "@platforms//os:windows": "$(location @qt_windows_x86_64//:moc) $(locations %s) -o $@ -f'%s'" % (hdr, header_path), From eafe04eeb10119644bfed39b3986d3d8159e48f5 Mon Sep 17 00:00:00 2001 From: sayter Date: Fri, 31 May 2024 23:10:53 +0800 Subject: [PATCH 23/30] bzlmod --- MODULE.bazel | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/MODULE.bazel b/MODULE.bazel index 00bb183..98015ad 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -1,6 +1,5 @@ -############################################################################### -# Bazel now uses Bzlmod by default to manage external dependencies. -# Please consider migrating your external dependencies from WORKSPACE to MODULE.bazel. -# -# For more details, please check https://github.com/bazelbuild/bazel/issues/18958 -############################################################################### +module( + name = "rules_qt", + version = "1.0.0", + compatibility_level = 1, +) From 14486913bc2d01e199923ef6288a30e7bb917cf7 Mon Sep 17 00:00:00 2001 From: sayter Date: Fri, 31 May 2024 23:13:54 +0800 Subject: [PATCH 24/30] add platforms module --- MODULE.bazel | 2 ++ 1 file changed, 2 insertions(+) diff --git a/MODULE.bazel b/MODULE.bazel index 98015ad..308a986 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -3,3 +3,5 @@ module( version = "1.0.0", compatibility_level = 1, ) + +bazel_dep(name = "platforms", version = "0.0.10") From 7738710b2ed65a4eaf09ce258b65a139b9e1e3e3 Mon Sep 17 00:00:00 2001 From: sayter Date: Fri, 31 May 2024 23:17:49 +0800 Subject: [PATCH 25/30] register toolchain --- MODULE.bazel | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/MODULE.bazel b/MODULE.bazel index 308a986..f01891c 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -5,3 +5,16 @@ module( ) bazel_dep(name = "platforms", version = "0.0.10") +bazel_dep(name = "bazel_skylib", version = "1.5.0") + +qt = use_extension("@rules_qt//:extensions.bzl", "qt") +qt.fetch() +use_repo( + qt, + "qt_linux_x86_64", + "qt_windows_x86_64", +) +register_toolchains( + "@rules_qt//tools:all", + dev_dependency = True, +) From 4ae3418a21d42e14d21e333f80306e6155c47a68 Mon Sep 17 00:00:00 2001 From: sayter Date: Fri, 31 May 2024 23:19:22 +0800 Subject: [PATCH 26/30] extensions --- extensions.bzl | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 extensions.bzl diff --git a/extensions.bzl b/extensions.bzl new file mode 100644 index 0000000..287b415 --- /dev/null +++ b/extensions.bzl @@ -0,0 +1,15 @@ +load("@rules_qt//:fetch_qt.bzl", "fetch_qt6") + +def _qt_impl(ctx): + for mod in ctx.modules: + if mod.name == "rules_qt": + fetch_qt6() + +_fetch = tag_class(attrs = {}) + +qt = module_extension( + implementation = _qt_impl, + tag_classes = { + "fetch": _fetch, + }, +) \ No newline at end of file From 14d24ecc951323f59dd142745adfa82f97c53f9d Mon Sep 17 00:00:00 2001 From: sayter Date: Fri, 31 May 2024 23:21:33 +0800 Subject: [PATCH 27/30] comment out unsupported rule --- fetch_qt.bzl | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/fetch_qt.bzl b/fetch_qt.bzl index 0adf654..8b03f0d 100644 --- a/fetch_qt.bzl +++ b/fetch_qt.bzl @@ -46,14 +46,14 @@ def fetch_qt6(): # $ brew link qt@6 # Check if path exists - native.new_local_repository( - name = "qt_mac_x86_64", - path = "/usr/local/opt/qt@6", #"/usr/local/opt/qt@6", - build_file = "@rules_qt//:qt_mac_x86_64.BUILD", - ) - - native.new_local_repository( - name = "qt_mac_aarch64", - path = "/opt/homebrew/", # after brew link, is't ok just use /opt/homebrew - build_file = "@rules_qt//:qt_mac_aarch64.BUILD", - ) + # native.new_local_repository( + # name = "qt_mac_x86_64", + # path = "/usr/local/opt/qt@6", #"/usr/local/opt/qt@6", + # build_file = "@rules_qt//:qt_mac_x86_64.BUILD", + # ) + + # native.new_local_repository( + # name = "qt_mac_aarch64", + # path = "/opt/homebrew/", # after brew link, is't ok just use /opt/homebrew + # build_file = "@rules_qt//:qt_mac_aarch64.BUILD", + # ) From f5368af2eba6c8892a1cc4183c9879bb36c4ea8b Mon Sep 17 00:00:00 2001 From: sayter Date: Tue, 8 Oct 2024 15:47:10 +0800 Subject: [PATCH 28/30] bzlmod support --- fetch_qt.bzl | 11 ++++--- qt.bzl | 65 ++++++++++++++++++++++++++++++----------- qt_libraries.bzl | 11 +++++++ qt_linux_x86_64.BUILD | 5 ++++ qt_mac_aarch64.BUILD | 5 ++++ qt_mac_x86_64.BUILD | 5 ++++ qt_windows_x86_64.BUILD | 5 ++++ 7 files changed, 84 insertions(+), 23 deletions(-) diff --git a/fetch_qt.bzl b/fetch_qt.bzl index 8b03f0d..ee6fb6d 100644 --- a/fetch_qt.bzl +++ b/fetch_qt.bzl @@ -9,10 +9,9 @@ def fetch_qt6(): http_archive( name = "qt_windows_x86_64", urls = [ - "https://dl.dropboxusercontent.com/scl/fi/z00b2gu5gtuiqrbg3w2ew/qt_6.5.3_windows_msvc2022_64.zip?rlkey=sfnbnx4md9fms5o7mmpe1lqlg&dl=0", + "https://dl.dropboxusercontent.com/scl/fi/5u79o4iqx7ija38h075rd/qt_6.7.3_windows_msvc2022_64_gamepad.zip?rlkey=c3gg9a4xw5s8ewyrnqz5gh82p&dl=0", ], - sha256 = "74e5d4e5dccad28d7e32cd4f9ea659b22143c4dca2dfb4eb98cc0c06372efe35", - strip_prefix = "6.5.3/msvc2022_64", + sha256 = "6cfec811307a9dea55fc11d24f6c6f828a8cacf39e12ff13740efb0b227cb2c1", build_file = "@rules_qt//:qt_windows_x86_64.BUILD", ) @@ -25,10 +24,10 @@ def fetch_qt6(): http_archive( name = "qt_linux_x86_64", urls = [ - "https://dl.dropboxusercontent.com/scl/fi/sjwx30o914oxm4rdxrkas/qt_6.5.1_linux_desktop_gcc_64.zip?rlkey=xulfkmvkrj9mdfbkv5928sjjk&dl=0", + "https://dl.dropboxusercontent.com/scl/fi/0qf3lcph52a3dfsf9gszb/qt_6.7.3_linux_desktop_gcc_64_gamepad.tar.xz?rlkey=aya7qoj1354ep1iunddgu8f6m&dl=0", ], - sha256 = "cd7a0190390d2ca68b5c06ac95d36af22836993233565acf2ec73b0f74d7c914", - strip_prefix = "6.5.1/gcc_64", + sha256 = "101dfab81e1b41d582476df5bf27c355871754b94597a72ad3eefe711aea43af", + strip_prefix = "Qt-6.7.3", build_file = "@rules_qt//:qt_linux_x86_64.BUILD", ) diff --git a/qt.bzl b/qt.bzl index f7db0ae..4e8d205 100644 --- a/qt.bzl +++ b/qt.bzl @@ -267,10 +267,15 @@ def qt_cc_library(name, srcs, hdrs, normal_hdrs = [], deps = None, copts = [], t ) qt_plugin_data = select({ - "@platforms//os:linux": ["@qt_linux_x86_64//:plugin_files", "@qt_linux_x86_64//:qml_files"], - "@rules_qt//:osx_x86_64": ["@qt_mac_x86_64//:plugin_files", "@qt_mac_x86_64//:qml_files"], - "@rules_qt//:osx_arm64": ["@qt_mac_aarch64//:plugin_files", "@qt_mac_aarch64//:qml_files"], - "@platforms//os:windows": ["@qt_windows_x86_64//:plugin_files", "@qt_windows_x86_64//:qml_files"], + "@platforms//os:linux": ["@qt_linux_x86_64//:qml", "@qt_linux_x86_64//:plugins", "@qt_linux_x86_64//:lib"], + "@rules_qt//:osx_x86_64": ["@qt_mac_x86_64//:plugins", "@qt_mac_x86_64//:qml", "@qt_mac_x86_64//:lib"], + "@rules_qt//:osx_arm64": ["@qt_mac_aarch64//:plugins", "@qt_mac_aarch64//:qml", "@qt_mac_aarch64//:lib"], + "@platforms//os:windows": [ + "@qt_windows_x86_64//:plugins", + "@qt_windows_x86_64//:qml", + "@qt_windows_x86_64//:plugin_files", + "@qt_windows_x86_64//:qml_files", + ], }) def update_dict(source, env): @@ -280,27 +285,27 @@ def update_dict(source, env): return result LINUX_ENV_DATA = { - "QT_QPA_PLATFORM_PLUGIN_PATH": "external/qt_linux_x86_64/plugins/platforms", - "QML2_IMPORT_PATH": "external/qt_linux_x86_64/qml", - "QT_PLUGIN_PATH": "external/qt_linux_x86_64/plugins", + "QT_QPA_PLATFORM_PLUGIN_PATH": "$(location @qt_linux_x86_64//:plugins)/platforms", + "QML2_IMPORT_PATH": "$(location @qt_linux_x86_64//:qml)", + "QT_PLUGIN_PATH": "$(location @qt_linux_x86_64//:plugins)", } MAC_X64_ENV_DATA = { - "QT_QPA_PLATFORM_PLUGIN_PATH": "external/qt_mac_x86_64/share/qt/plugins/platforms", - "QML2_IMPORT_PATH": "external/qt_mac_x86_64/qml", - "QT_PLUGIN_PATH": "external/qt_mac_x86_64/share/qt/plugins", + "QT_QPA_PLATFORM_PLUGIN_PATH": "$(location @qt_mac_x86_64//:plugins)/platforms", + "QML2_IMPORT_PATH": "$(location @qt_mac_x86_64//:qml)", + "QT_PLUGIN_PATH": "$(location @qt_mac_x86_64//:plugins)", } WINDOWS_ENV_DATA = { - "QT_QPA_PLATFORM_PLUGIN_PATH": "external/qt_windows_x86_64/plugins/platforms", - "QML2_IMPORT_PATH": "external/qt_windows_x86_64/qml", - "QT_PLUGIN_PATH": "external/qt_windows_x86_64/plugins", + "QT_QPA_PLATFORM_PLUGIN_PATH": "$(location @qt_windows_x86_64//:plugins)/platforms", + "QML2_IMPORT_PATH": "$(location @qt_windows_x86_64//:qml)", + "QT_PLUGIN_PATH": "$(location @qt_windows_x86_64//:plugins)", } MAC_M1_ENV_DATA = { - "QT_QPA_PLATFORM_PLUGIN_PATH": "external/qt_mac_aarch64/share/qt/plugins/platforms", - "QML2_IMPORT_PATH": "external/qt_mac_aarch64/qml", - "QT_PLUGIN_PATH": "external/qt_mac_aarch64/share/qt/plugins", + "QT_QPA_PLATFORM_PLUGIN_PATH": "$(location @qt_mac_aarch64//:plugins)/platforms", + "QML2_IMPORT_PATH": "$(location @qt_mac_aarch64//:qml)", + "QT_PLUGIN_PATH": "$(location @qt_mac_aarch64//:plugins)", } def qt_cc_binary(name, srcs, deps = None, copts = [], data = [], env = {}, **kwargs): @@ -319,6 +324,32 @@ def qt_cc_binary(name, srcs, deps = None, copts = [], data = [], env = {}, **kwa mac_x64_env_data = update_dict(MAC_X64_ENV_DATA, env) windows_env_data = update_dict(WINDOWS_ENV_DATA, env) mac_m1_env_data = update_dict(MAC_M1_ENV_DATA, env) + env_file = [] + native.genrule( + name = name + "_env", + tools = qt_plugin_data, + outs = ["qt_env.ini"], + cmd = select({ + "@platforms//os:linux": + "echo $$\"LD_LIBRARY_PATH: $(location @qt_linux_x86_64//:lib)\" > $@ \ + $$\"\r\nQT_QPA_PLATFORM_PLUGIN_PATH: $(location @qt_linux_x86_64//:plugins)/platforms\" > $@ \ + $$\"\r\nQML2_IMPORT_PATH: $(location @qt_linux_x86_64//:qml)\" > $@ \ + $$\"\r\nQT_PLUGIN_PATH: $(location @qt_linux_x86_64//:plugins)\" > $@", + "@rules_qt//:osx_x86_64": + "echo $$\"QT_QPA_PLATFORM_PLUGIN_PATH: $(location @qt_mac_x86_64//:plugins)/platforms\" > $@ \ + $$\"\r\nQML2_IMPORT_PATH: $(location @qt_mac_x86_64//:qml)\" > $@ \ + $$\"\r\nQT_PLUGIN_PATH: $(location @qt_mac_x86_64//:plugins)\" > $@", + "@rules_qt//:osx_arm64": + "echo $$\"QT_QPA_PLATFORM_PLUGIN_PATH: $(location @qt_mac_aarch64//:plugins)/platforms\" > $@ \ + $$\"\r\nQML2_IMPORT_PATH: $(location @qt_mac_aarch64//:qml)\" > $@ \ + $$\"\r\nQT_PLUGIN_PATH: $(location @qt_mac_aarch64//:plugins)\" > $@", + "@platforms//os:windows": + "echo $$\"QT_QPA_PLATFORM_PLUGIN_PATH: $(location @qt_windows_x86_64//:plugins)/platforms\" > $@ \ + $$\"\r\nQML2_IMPORT_PATH: $(location @qt_windows_x86_64//:qml)\" > $@ \ + $$\"\r\nQT_PLUGIN_PATH: $(location @qt_windows_x86_64//:plugins)\" > $@", + }), + ) + env_file.append("qt_env.ini") native.cc_binary( name = name, srcs = srcs, @@ -327,7 +358,7 @@ def qt_cc_binary(name, srcs, deps = None, copts = [], data = [], env = {}, **kwa "@platforms//os:windows": [], "//conditions:default": ["-fPIC"], }), - data = qt_plugin_data + data, + data = qt_plugin_data + env_file + data, env = select({ "@platforms//os:linux": linux_env_data, "@rules_qt//:osx_x86_64": mac_x64_env_data, diff --git a/qt_libraries.bzl b/qt_libraries.bzl index 39305a1..2217f41 100644 --- a/qt_libraries.bzl +++ b/qt_libraries.bzl @@ -15,6 +15,7 @@ QT_LIBRARIES = [ ("designer", "QtDesigner", "Qt6Designer", [":qt_xml", ":qt_opengl_widgets", ":qt_widgets", ":qt_gui", ":qt_core"]), ("designer_components", "QtDesigner", "Qt6Designer", [":qt_designer", ":qt_xml", ":qt_widgets", ":qt_gui", ":qt_core"]), ("help", "QtHelp", "Qt6Help", [":qt_sql", ":qt_widgets", ":qt_gui", ":qt_core"]), + ("location", "QtLocation", "Qt6Location", [":qt_core"]), # ("json_rpc", "QtJsonRpc", "Qt6JsonRpc", [":qt_core"]), # ("language_server", "QtLanguageServer", "Qt6LanguageServer", [":qt_json_rpc", ":qt_core"]), ("multimedia", "QtMultimedia", "Qt6Multimedia", [":qt_network", ":qt_gui", ":qt_core"]), @@ -80,6 +81,9 @@ QT_LIBRARIES = [ ("quick_web_engine", "QtWebEngineQuick", "Qt6WebEngineQuick", [ ":qt_web_engine_core", ":qt_quick", ":qt_gui", ":qt_web_channel", ":qt_qml", ":qt_network", ":qt_core" ]), + ("quick_web_channel", "QtWebChannelQuick", "Qt6WebChannelQuick", [ + ":qt_web_engine_core", ":qt_quick", ":qt_gui", ":qt_web_channel", ":qt_qml", ":qt_network", ":qt_core" + ]), ("quick_3d_effects", "QtQuick3DEffects", "Qt6Quick3DEffects", [":qt_qml", ":qt_core"]), # ("quick_3d_glsl_parser", "QtQuick3DGlslParser", "Qt6Quick3DGlslParser", [":qt_core"]), ("quick_3d_helpers", "QtQuick3DHelpers", "Qt6Quick3DHelpers", [":qt_quick_3d", ":qt_gui", ":qt_qml", ":qt_core"]), @@ -90,6 +94,10 @@ QT_LIBRARIES = [ ("quick_3d_runtime_render", "QtQuick3DRuntimeRender", "Qt6Quick3DRuntimeRender", [":qt_quick_3d_utils", ":qt_quick", ":qt_shader_tools", ":qt_gui", ":qt_core"]), ("quick_3d_utils", "QtQuick3DUtils", "Qt6Quick3DUtils", [":qt_gui", ":qt_core"]), ("quick_controls2", "QtQuickControls2", "Qt6QuickControls2", [":qt_quick_templates2", ":qt_gui", ":qt_qml", ":qt_core"]), + ("quick_controls2_basic", "QtQuickControls2Basic", "Qt6QuickControls2Basic", [":qt_quick_templates2", ":qt_gui", ":qt_qml", ":qt_core"]), + ("quick_controls2_fusion", "QtQuickControls2Fusion", "Qt6QuickControls2Fusion", [":qt_quick_templates2", ":qt_gui", ":qt_qml", ":qt_core"]), + ("quick_controls2_material", "QtQuickControls2Material", "Qt6QuickControls2Material", [":qt_quick_templates2", ":qt_gui", ":qt_qml", ":qt_core"]), + ("quick_controls2_material_style_impl", "QtQuickControls2MaterialStyleImpl", "Qt6QuickControls2MaterialStyleImpl", [":qt_quick_templates2", ":qt_gui", ":qt_qml", ":qt_core"]), ("quick_controls2_impl", "QtQuickControls2Impl", "Qt6QuickControls2Impl", [":qt_quick_templates2", ":qt_quick", ":qt_gui", ":qt_qml", ":qt_core"]), ("quick_dialogs2", "QtQuickDialogs2", "Qt6QuickDialogs2", [":qt_quick_dialogs2_quick_impl", ":qt_quick_dialogs2_utils", ":qt_quick", ":qt_gui", ":qt_qml", ":qt_core"]), ("quick_dialogs2_quick_impl", "Qt6QuickDialogs2QuickImpl", "Qt6QuickDialogs2QuickImpl", [ @@ -123,4 +131,7 @@ QT_LIBRARIES = [ ("labs_settings", "QtLabsSettings", "Qt6LabsSettings", [":qt_qml", ":qt_core"]), ("labs_shared_image", "QtLabsSharedImage", "Qt6LabsSharedImage", [":qt_quick", ":qt_qml", ":qt_gui", ":qt_core"]), ("labs_wave_front_mesh", "QtLabsWavefrontMesh", "Qt6LabsWavefrontMesh", [":qt_quick", ":qt_qml", ":qt_gui", ":qt_core"]), + ## legacy + ("gamepad_legacy", "QtGamepadLegacy", "Qt6GamepadLegacy", [":qt_core"]), + ("gamepad_legacy_quick", "QtGamepadLegacyQuick", "Qt6GamepadLegacyQuick", [":qt_quick", ":qt_qml"]), ] diff --git a/qt_linux_x86_64.BUILD b/qt_linux_x86_64.BUILD index 8b9c996..fbaa861 100644 --- a/qt_linux_x86_64.BUILD +++ b/qt_linux_x86_64.BUILD @@ -60,3 +60,8 @@ filegroup( srcs = glob(["qml/**/*"]), visibility = ["//visibility:public"], ) + +exports_files( + ["qml", "plugins", "lib"], + visibility = ["//visibility:public"], +) diff --git a/qt_mac_aarch64.BUILD b/qt_mac_aarch64.BUILD index 1e02f86..ea95817 100644 --- a/qt_mac_aarch64.BUILD +++ b/qt_mac_aarch64.BUILD @@ -55,3 +55,8 @@ filegroup( srcs = glob(["qml/**/*"]), visibility = ["//visibility:public"], ) + +exports_files( + ["qml", "plugins", "lib"], + visibility = ["//visibility:public"], +) diff --git a/qt_mac_x86_64.BUILD b/qt_mac_x86_64.BUILD index d58641a..e292cf0 100644 --- a/qt_mac_x86_64.BUILD +++ b/qt_mac_x86_64.BUILD @@ -55,3 +55,8 @@ filegroup( srcs = glob(["qml/**/*"]), visibility = ["//visibility:public"], ) + +exports_files( + ["qml", "plugins", "lib"], + visibility = ["//visibility:public"], +) diff --git a/qt_windows_x86_64.BUILD b/qt_windows_x86_64.BUILD index 1c49417..ca1d760 100644 --- a/qt_windows_x86_64.BUILD +++ b/qt_windows_x86_64.BUILD @@ -72,3 +72,8 @@ filegroup( srcs = glob(["qml/**/*"]), visibility = ["//visibility:public"], ) + +exports_files( + ["qml", "plugins", "lib"], + visibility = ["//visibility:public"], +) From 6c0124fece859b0363f0b075ae6acf6fa5db5255 Mon Sep 17 00:00:00 2001 From: sayter Date: Thu, 17 Oct 2024 22:16:09 +0800 Subject: [PATCH 29/30] upgrade qt to 6.8.0 --- MODULE.bazel | 3 ++- fetch_qt.bzl | 50 ++++++++++------------------------ qt_libraries.bzl | 1 + qt_mac_aarch64.BUILD | 19 +++++++------ qt_mac_x86_64.BUILD | 62 ------------------------------------------- tests/.bazelrc | 50 ++++++++++++++-------------------- tests/MODULE.bazel | 24 ++++++++++++----- tests/WORKSPACE.bazel | 12 --------- 8 files changed, 66 insertions(+), 155 deletions(-) delete mode 100644 qt_mac_x86_64.BUILD diff --git a/MODULE.bazel b/MODULE.bazel index f01891c..51e8c22 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -5,7 +5,7 @@ module( ) bazel_dep(name = "platforms", version = "0.0.10") -bazel_dep(name = "bazel_skylib", version = "1.5.0") +bazel_dep(name = "bazel_skylib", version = "1.7.1") qt = use_extension("@rules_qt//:extensions.bzl", "qt") qt.fetch() @@ -13,6 +13,7 @@ use_repo( qt, "qt_linux_x86_64", "qt_windows_x86_64", + "qt_mac_aarch64", ) register_toolchains( "@rules_qt//tools:all", diff --git a/fetch_qt.bzl b/fetch_qt.bzl index ee6fb6d..f978b5c 100644 --- a/fetch_qt.bzl +++ b/fetch_qt.bzl @@ -9,50 +9,28 @@ def fetch_qt6(): http_archive( name = "qt_windows_x86_64", urls = [ - "https://dl.dropboxusercontent.com/scl/fi/5u79o4iqx7ija38h075rd/qt_6.7.3_windows_msvc2022_64_gamepad.zip?rlkey=c3gg9a4xw5s8ewyrnqz5gh82p&dl=0", + "https://dl.dropboxusercontent.com/scl/fi/a75eyqtu0542t203eyie2/qt_6.8.0_windows_msvc2022_64_gamepad.zip?rlkey=l2ucxa4by8c8tp3xioqoamm89&dl=0", ], - sha256 = "6cfec811307a9dea55fc11d24f6c6f828a8cacf39e12ff13740efb0b227cb2c1", + sha256 = "59aa42d34a1b5f15dfc915830a1dbebd90c7b418cf1b726eff8d0fa2766d9827", build_file = "@rules_qt//:qt_windows_x86_64.BUILD", ) - #native.new_local_repository( - # name = "qt_windows_x86_64", - # path = "C:\\Qt\\6.4.0\\msvc2019_64", - # build_file = "@rules_qt//:qt_windows_x86_64.BUILD", - #) - http_archive( name = "qt_linux_x86_64", urls = [ - "https://dl.dropboxusercontent.com/scl/fi/0qf3lcph52a3dfsf9gszb/qt_6.7.3_linux_desktop_gcc_64_gamepad.tar.xz?rlkey=aya7qoj1354ep1iunddgu8f6m&dl=0", + "https://dl.dropboxusercontent.com/scl/fi/n5aelrs4qg6lweuitb795/qt_6.8.0_linux_desktop_gcc_64_gamepad.tar.xz?rlkey=miuhkfeat53z7xk85y8abi7o3&dl=0", ], - sha256 = "101dfab81e1b41d582476df5bf27c355871754b94597a72ad3eefe711aea43af", - strip_prefix = "Qt-6.7.3", + sha256 = "fc18569262fa23c19009a66cfe39ce5761c8e99bc161820cb971be0beec0bb8b", + strip_prefix = "Qt-6.8.0", build_file = "@rules_qt//:qt_linux_x86_64.BUILD", ) - #http_archive( - # name = "qt_mac_x86_64", - # urls = ["https://vertexwahn.de/lfs/v1/qt_mac_x86_64.zip"], - # sha256 = "9543aa178a6fe6aa138e4319fb07a106375b7fef11be150d154d5c1b8a321721", - # strip_prefix = "6.2.4/macos", - # build_file = "@rules_qt////:qt_mac_x86_64.BUILD", - #) - - # On macOS we make use of an system installed Qt6 - # installation works via: - # $ brew install qt@6 - # $ brew link qt@6 - - # Check if path exists - # native.new_local_repository( - # name = "qt_mac_x86_64", - # path = "/usr/local/opt/qt@6", #"/usr/local/opt/qt@6", - # build_file = "@rules_qt//:qt_mac_x86_64.BUILD", - # ) - - # native.new_local_repository( - # name = "qt_mac_aarch64", - # path = "/opt/homebrew/", # after brew link, is't ok just use /opt/homebrew - # build_file = "@rules_qt//:qt_mac_aarch64.BUILD", - # ) + http_archive( + name = "qt_mac_aarch64", + urls = [ + "https://dl.dropboxusercontent.com/scl/fi/8io4wc9cx2kd2vfwswjmg/qt_6.8.0_mac_aarch64_gamepad.tar.xz?rlkey=afkk9qrub9i1gmelv7vktgtci&dl=0", + ], + sha256 = "07be3436bfb31b3a2e629907ca39a8652febe563046094cdc7373b7ff28228c4", + strip_prefix = "Qt-6.8.0", + build_file = "@rules_qt//:qt_mac_aarch64.BUILD", + ) diff --git a/qt_libraries.bzl b/qt_libraries.bzl index 2217f41..d7bfa76 100644 --- a/qt_libraries.bzl +++ b/qt_libraries.bzl @@ -69,6 +69,7 @@ QT_LIBRARIES = [ ("qml_remote_objects", "QtRemoteObjectsQml", "Qt6RemoteObjectsQml", [":qt_remote_objects", ":qt_qml", ":qt_core"]), ("qml_scxml", "QtScxmlQml", "Qt6ScxmlQml", [":qt_scxml", ":qt_qml", ":qt_core"]), ("qml_state_machine", "QtStateMachineQml", "Qt6StateMachineQml", [":qt_state_machine", ":qt_qml", ":qt_core"]), + ("qml_meta", "QtQmlMeta", "Qt6QmlMeta", [":qt_qml"]), ## qt quick ("quick", "QtQuick", "Qt6Quick", [":qt_gui", ":qt_qml"]), # ("quick_pdf", "QtPdfQuick", "Qt6PdfQuick", [":qt_quick", ":qt_pdf", ":qt_gui", ":qt_qml", ":qt_core"]), diff --git a/qt_mac_aarch64.BUILD b/qt_mac_aarch64.BUILD index ea95817..2751343 100644 --- a/qt_mac_aarch64.BUILD +++ b/qt_mac_aarch64.BUILD @@ -3,14 +3,17 @@ load("@rules_qt//:qt_libraries.bzl", "QT_LIBRARIES") [ cc_library( name = "qt_%s_mac" % name, - hdrs = glob(["include/%s/**" % include_folder]), # allow_empty = True + hdrs = glob(["lib/%s.framework/Headers/**" % include_folder]), # allow_empty = True includes = [ - "include", - "include/%s" % include_folder, + "lib/%s.framework/Headers" % include_folder, ], - linkopts = ["-F/opt/homebrew/lib"] + [ + additional_linker_inputs = [":lib"], + linkopts = ["-F $(location :lib)"] + [ "-framework %s" % library_name.replace("6", ""), # macOS qt libs do not contain a 6 - e.g. instead of Qt6Core the lib is called QtCore + "-rpath $(location :lib)", ], + include_prefix = "%s" % include_folder, + strip_include_prefix = "lib/%s.framework/Headers" % include_folder, target_compatible_with = ["@platforms//os:osx"], visibility = ["//visibility:public"], ) @@ -28,25 +31,25 @@ cc_library( filegroup( name = "uic", - srcs = ["share/qt/libexec/uic"], + srcs = ["libexec/uic"], visibility = ["//visibility:public"], ) filegroup( name = "moc", - srcs = ["share/qt/libexec/moc"], + srcs = ["libexec/moc"], visibility = ["//visibility:public"], ) filegroup( name = "rcc", - srcs = ["share/qt/libexec/rcc"], + srcs = ["libexec/rcc"], visibility = ["//visibility:public"], ) filegroup( name = "plugin_files", - srcs = glob(["share/qt/plugins/**/*"]), + srcs = glob(["plugins/**/*"]), visibility = ["//visibility:public"], ) diff --git a/qt_mac_x86_64.BUILD b/qt_mac_x86_64.BUILD deleted file mode 100644 index e292cf0..0000000 --- a/qt_mac_x86_64.BUILD +++ /dev/null @@ -1,62 +0,0 @@ -load("@rules_qt//:qt_libraries.bzl", "QT_LIBRARIES") - -[ - cc_library( - name = "qt_%s_mac" % name, - hdrs = glob(["include/%s/**" % include_folder]), # allow_empty = True - includes = [ - "include", - "include/%s" % include_folder, - ], - linkopts = ["-F/usr/local/opt/qt@6/lib"] + [ - "-framework %s" % library_name.replace("6", ""), # macOS qt libs do not contain a 6 - e.g. instead of Qt6Core the lib is called QtCore - ], - target_compatible_with = ["@platforms//os:osx"], - visibility = ["//visibility:public"], - ) - for name, include_folder, library_name, _ in QT_LIBRARIES -] - -cc_library( - name = "qt_hdrs", - hdrs = glob(["include/**"]), - includes = [ - "include", - ], - visibility = ["//visibility:public"], -) - -filegroup( - name = "uic", - srcs = ["share/qt/libexec/uic"], - visibility = ["//visibility:public"], -) - -filegroup( - name = "moc", - srcs = ["share/qt/libexec/moc"], - visibility = ["//visibility:public"], -) - -filegroup( - name = "rcc", - srcs = ["share/qt/libexec/rcc"], - visibility = ["//visibility:public"], -) - -filegroup( - name = "plugin_files", - srcs = glob(["share/qt/plugins/**/*"]), - visibility = ["//visibility:public"], -) - -filegroup( - name = "qml_files", - srcs = glob(["qml/**/*"]), - visibility = ["//visibility:public"], -) - -exports_files( - ["qml", "plugins", "lib"], - visibility = ["//visibility:public"], -) diff --git a/tests/.bazelrc b/tests/.bazelrc index 247910a..3dae9b5 100644 --- a/tests/.bazelrc +++ b/tests/.bazelrc @@ -1,36 +1,26 @@ -# Setup compiler flags - required for Qt6 is at least C++17 -build:gcc9 --cxxopt=-std=c++2a -build:gcc9 --cxxopt=-Wall -build:gcc9 --cxxopt=-Werror +# GCC +build:gccd --cxxopt=-std=c++20 +build:gccd --cxxopt=-Wall +build:gccd --cxxopt=-Werror +build:gccd --compilation_mode=dbg -# GCC 11.2 -#build:gcc11 --cxxopt=-std=c++23 # blocked by emsdk -build:gcc11 --cxxopt=-std=c++20 -build:gcc11 --cxxopt=-Wall -#build:gcc11 --cxxopt=-Werror -#build:gcc11 --cxxopt=-Wno-error=volatile # blocked by emsdk -##build:gcc11 --cxxopt=-Wextra - -# Visual Studio 2019 -build:vs2019 --cxxopt=/std:c++20 -build:vs2019 --cxxopt=/Zc:__cplusplus # Untested -build:vs2019 --enable_runfiles # https://github.com/bazelbuild/bazel/issues/8843 -build:vs2019 --define compiler=vs2019 -build:vs2019 --copt=-DWIN32_LEAN_AND_MEAN -build:vs2019 --copt=-DNOGDI -build:vs2019 --host_copt=-DWIN32_LEAN_AND_MEAN -build:vs2019 --host_copt=-DNOGDI +# GCC +build:gcc --cxxopt=-std=c++20 +build:gcc --cxxopt=-Wall +build:gcc --cxxopt=-Werror +build:gcc --compilation_mode=opt # Visual Studio 2022 -build:vs2022 --cxxopt=/std:c++20 -build:vs2022 --cxxopt=/Zc:__cplusplus -build:vs2022 --enable_runfiles # https://github.com/bazelbuild/bazel/issues/8843 -build:vs2022 --define compiler=vs2022 -build:vs2022 --copt=-DWIN32_LEAN_AND_MEAN -build:vs2022 --copt=-DNOGDI -build:vs2022 --host_copt=-DWIN32_LEAN_AND_MEAN -build:vs2022 --host_copt=-DNOGDI +build:vs --cxxopt=/std:c++20 +build:vs --cxxopt=/Zc:__cplusplus +build:vs --enable_runfiles # https://github.com/bazelbuild/bazel/issues/8843 +build:vs --define compiler=vs2022 +build:vs --copt=-DWIN32_LEAN_AND_MEAN +build:vs --copt=-DNOGDI +build:vs --host_copt=-DWIN32_LEAN_AND_MEAN +build:vs --host_copt=-DNOGDI # macOS (e.g. Clang 12.0.0) -build:macos --cxxopt=-std=c++2a +build:macos --cxxopt=-std=c++20 build:macos --cxxopt=-Wall +build:macos --repo_env=CC=clang diff --git a/tests/MODULE.bazel b/tests/MODULE.bazel index 00bb183..05aa256 100644 --- a/tests/MODULE.bazel +++ b/tests/MODULE.bazel @@ -1,6 +1,18 @@ -############################################################################### -# Bazel now uses Bzlmod by default to manage external dependencies. -# Please consider migrating your external dependencies from WORKSPACE to MODULE.bazel. -# -# For more details, please check https://github.com/bazelbuild/bazel/issues/18958 -############################################################################### +bazel_dep(name = "rules_qt") +local_path_override( + module_name = "rules_qt", + path = "..", +) + +qt = use_extension("@rules_qt//:extensions.bzl", "qt") +qt.fetch() +use_repo( + qt, + "qt_linux_x86_64", + "qt_windows_x86_64", + "qt_mac_aarch64", +) +register_toolchains( + "@rules_qt//tools:all", + dev_dependency = True, +) diff --git a/tests/WORKSPACE.bazel b/tests/WORKSPACE.bazel index 63e9c6c..e69de29 100644 --- a/tests/WORKSPACE.bazel +++ b/tests/WORKSPACE.bazel @@ -1,12 +0,0 @@ -local_repository( - name = "rules_qt", - path = "..", -) - -load("@rules_qt//:fetch_qt.bzl", "fetch_qt6") - -fetch_qt6() - -load("@rules_qt//tools:qt_toolchain.bzl", "register_qt_toolchains") - -register_qt_toolchains() From 6479e6401ae0bfe51645ece6871c99e7e297d464 Mon Sep 17 00:00:00 2001 From: JanusCo <163771509+JanusCo@users.noreply.github.com> Date: Sun, 17 Mar 2024 15:50:42 -0400 Subject: [PATCH 30/30] Update shell command Slightly editing shell command to make it easier to paste and run. --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index cac853b..bed8eeb 100644 --- a/README.md +++ b/README.md @@ -31,8 +31,8 @@ The following tools should be installed: *All platforms:* ```shell -git clone https://github.com/Vertexwahn/rules_qt6 -cd tests +git clone https://github.com/Vertexwahn/rules_qt6 && +cd rules_qt6/tests ``` *Run Hello World demo with Windows 10/11 x64 with Visual Studio 2019:*