{"id":18054505,"url":"https://github.com/vertexwahn/rules_qt6","last_synced_at":"2025-04-10T23:13:19.984Z","repository":{"id":42424472,"uuid":"368675696","full_name":"Vertexwahn/rules_qt6","owner":"Vertexwahn","description":"Bazel rules for Qt6","archived":false,"fork":false,"pushed_at":"2025-02-05T14:25:22.000Z","size":678,"stargazers_count":34,"open_issues_count":6,"forks_count":10,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-04-10T23:13:13.637Z","etag":null,"topics":["bazel","bazel-rules","bazel-support","cpp","qml","qt","qt6","ui"],"latest_commit_sha":null,"homepage":"https://vertexwahn.de/page/open_source/","language":"Starlark","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Vertexwahn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-05-18T21:55:54.000Z","updated_at":"2025-03-18T05:16:06.000Z","dependencies_parsed_at":"2024-03-17T20:41:04.468Z","dependency_job_id":null,"html_url":"https://github.com/Vertexwahn/rules_qt6","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vertexwahn%2Frules_qt6","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vertexwahn%2Frules_qt6/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vertexwahn%2Frules_qt6/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vertexwahn%2Frules_qt6/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Vertexwahn","download_url":"https://codeload.github.com/Vertexwahn/rules_qt6/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248312135,"owners_count":21082638,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bazel","bazel-rules","bazel-support","cpp","qml","qt","qt6","ui"],"created_at":"2024-10-31T00:11:30.235Z","updated_at":"2025-04-10T23:13:19.960Z","avatar_url":"https://github.com/Vertexwahn.png","language":"Starlark","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n\u003c!--\nSPDX-FileCopyrightText: 2022 Julian Amann \u003cdev@vertexwahn.de\u003e\nSPDX-License-Identifier: Apache-2.0\n--\u003e\n\n[![Support Ukraine](https://img.shields.io/badge/Support-Ukraine-FFD500?style=flat\u0026labelColor=005BBB)](https://opensource.fb.com/support-ukraine)\n\n# Bazel rules for Qt6\n\n## Goal \n\nThe goal of these rules is to be able to build [Qt6](https://www.qt.io/product/qt6) applications using [Bazel](https://bazel.build/) on Windows, \nLinux and macOS without the need to preinstall Qt6. \nAll the magic to set up Qt6 should be done by Bazel with as little effort as possible.\n\n## Quick start\n\nThis project uses [Bazel](https://bazel.build/) as a build system. \nThe current used version of Bazel is defined in [.bazelversion](tests/.bazelversion).\n\n**Prerequisites:**\n\nThe following tools should be installed:\n- [Git](https://git-scm.com/)\n- [Bazel](https://bazel.build/install)\n- A C++ compiler (GCC, Visual Studio, Clang, etc.)\n\n**Checkout, build, and run:**\n\n*All platforms:*\n\n```shell\ngit clone https://github.com/Vertexwahn/rules_qt6\ncd rules_qt6/tests\n```\n\n*Run Hello World demo with Windows 10/11 x64 with Visual Studio 2019:*\n\n```shell\nbazel run --config=vs2019 //hello_world:hello_world\n```\n\n*Run Hello World demo with Windows 10/11 x64 with Visual Studio 2022:*\n\n```shell\nbazel run --config=vs2022 //hello_world:hello_world\n```\n\n*Run Hello World demo with Ubuntu 20.04:*\n\n```shell\nbazel run --config=gcc9 //hello_world:hello_world\n```\n\n*Run Hello World demo with Ubuntu 22.04:*\n\n```shell\nbazel run --config=gcc11 //hello_world:hello_world\n```\n\n*Run Hello World demo with Ubuntu 24.04:*\n\n```shell\nbazel run --config=gcc13 //hello_world:hello_world\n```\n\n*Run Hello World demo with macOS 11/12:*\n\n```shell\n# Install Homebrew\n/bin/bash -c \"$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)\"\nbrew install qt@6 # Unfortunately a preinstalled version of Qt6 is still needed on macOS \nbrew link qt@6\nbazel run --config=macos //hello_world:hello_world\n```\n\n**Expected output**\n\nThe expected output should be similar (depending on your platform) to the following screenshots:\n\n*Windows*\n\n![Screenshot of HelloWorld demo on Windows 11](/docs/screenshots/hello_world_Windows11.png)\n\n*Ubuntu*\n\n![Screenshot of HelloWorld demo on Ubuntu 22.04](/docs/screenshots/hello_world_Ubuntu22.04.png)\n\n*macOS*\n\n![Screenshot of HelloWorld demo on macOS](/docs/screenshots/hello_world_macOS12_M1.png)\n\n**More Examples**\n\nMore examples can be found in the [tests](tests) directory.\n\n## Current status\n\nCurrently, on macOS, these rules need a preinstalled version of Qt on the system (`brew install qt@6 \u0026\u0026 brew link qt@6`).\nOn Windows and Linux it should be possible to run `bazel run --config=[gcc9|gcc11|vs2019|vs2022] //hello_world:hello_world` without the need to preinstall Bazel.\n\nThese rules require at least Bazel 4.0.0 to work.\nWith some small modifications, you can get work these rules also on earlier versions of Bazel.\n\nA prebuild version of Qt is fetched from [vertexwahn.de](https://vertexwahn.de/).\nImplementation details can be found in [fetch_qt.bzl](fetch_qt.bzl).\n\nI created a [`.bazelrc`](tests/.bazelrc) file that contains a config for `vs2019`, `vs2022`, `gcc9`, `gcc11`, and ``macos`. \nThis is needed since Qt6 needs at least C++17 standard enabled and different C++ compilers need different flags to enable this.\n\n## Contributions\n\nAny improvements to the Qt6 build experience using Bazel are welcome. \nMaybe you have solved this problem already. \nIn this case, \nI would appreciate it if you could share your efforts under some permissive license.\nIf you name no specific license I assume you are fine with the current used license of this project (Apache 2.0 License).\n\n## Similar projects\n\n- [aabtop/rules_qt](https://github.com/aabtop/rules_qt)\n- [bbreslauer/qt-bazel-example](https://github.com/bbreslauer/qt-bazel-example)\n- [justbuchanan/bazel_rules_qt](https://github.com/justbuchanan/bazel_rules_qt)\n\n## License\n\nThis work is published under Apache 2.0 License.\n\nThis work builds on top of [justbuchanan/bazel_rules_qt](https://github.com/justbuchanan/bazel_rules_qt) which is also licensed under Apache 2.0 and \nwas forked from [bbreslauer/qt-bazel-example](https://github.com/bbreslauer/qt-bazel-example).\nSee here for details: https://github.com/justbuchanan/bazel_rules_qt/graphs/contributors\n\n## Thanks to all contributors ❤\n\n \u003ca href = \"https://github.com/Vertexwahn/rules_qt6/graphs/contributors\"\u003e\n   \u003cimg src = \"https://contrib.rocks/image?repo=Vertexwahn/rules_qt6\"/\u003e\n \u003c/a\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvertexwahn%2Frules_qt6","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvertexwahn%2Frules_qt6","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvertexwahn%2Frules_qt6/lists"}