From 3ae369fb4aadc9725a85e99a1f9392762223eda8 Mon Sep 17 00:00:00 2001 From: Ezekiel Warren Date: Thu, 11 Mar 2021 20:40:27 -0800 Subject: [PATCH] linux support --- .bazelrc | 23 ++++++++++++----------- WORKSPACE | 21 +++++++++++++++++++++ 2 files changed, 33 insertions(+), 11 deletions(-) diff --git a/.bazelrc b/.bazelrc index 913e3b5..dc995d0 100644 --- a/.bazelrc +++ b/.bazelrc @@ -1,14 +1,15 @@ -# Building on non-windows with not clang-cl is not supported at this time -# See issue: https://github.com/zaucy/ZoneControl/issues/82 -build --compiler=clang-cl -build --cxxopt=-fcolor-diagnostics -build --cxxopt=-fansi-escape-codes -build --cxxopt=/D_HAS_DEPRECATED_RESULT_OF=1 -build --cxxopt=-Xclang +common --enable_platform_specific_config + build --cxxopt=-std=c++20 -build --cxxopt=/Zc:__cplusplus +build --cxxopt=-Wno-macro-redefined # Suppress a boost warning -build --compilation_mode=opt +build:windows --compiler=clang-cl +build:windows --cxxopt=-fcolor-diagnostics +build:windows --cxxopt=-fansi-escape-codes +build:windows --cxxopt=/D_HAS_DEPRECATED_RESULT_OF=1 +build:windows --cxxopt=-Xclang +build:windows --cxxopt=/Zc:__cplusplus +build:windows --copt=/experimental:preprocessor +build:windows --host_copt=/experimental:preprocessor -# For boost, because it's really annoying. -build --cxxopt=-Wno-macro-redefined +build:linux --crosstool_top=@llvm_toolchain//:toolchain diff --git a/WORKSPACE b/WORKSPACE index 230520e..e3bf1b4 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -48,3 +48,24 @@ http_archive( load("@com_github_zaucy_rules_7zip//:setup.bzl", "setup_7zip") setup_7zip() + +http_archive( + name = "com_grail_bazel_toolchain", + strip_prefix = "bazel-toolchain-master", + urls = ["https://github.com/grailbio/bazel-toolchain/archive/master.tar.gz"], +) + +load("@com_grail_bazel_toolchain//toolchain:deps.bzl", "bazel_toolchain_dependencies") + +bazel_toolchain_dependencies() + +load("@com_grail_bazel_toolchain//toolchain:rules.bzl", "llvm_toolchain") + +llvm_toolchain( + name = "llvm_toolchain", + llvm_version = "11.0.0", +) + +load("@llvm_toolchain//:toolchains.bzl", "llvm_register_toolchains") + +llvm_register_toolchains()