Skip to content

Commit

Permalink
linux support
Browse files Browse the repository at this point in the history
  • Loading branch information
zaucy committed Mar 12, 2021
1 parent 97ccf44 commit 3ae369f
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 11 deletions.
23 changes: 12 additions & 11 deletions .bazelrc
Original file line number Diff line number Diff line change
@@ -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
21 changes: 21 additions & 0 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -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()

0 comments on commit 3ae369f

Please sign in to comment.