https://github.com/oasisdigital/bazel-c-cpp-example
https://github.com/oasisdigital/bazel-c-cpp-example
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/oasisdigital/bazel-c-cpp-example
- Owner: OasisDigital
- License: other
- Created: 2022-03-21T20:54:11.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2022-09-14T16:27:07.000Z (almost 4 years ago)
- Last Synced: 2025-02-16T15:04:23.906Z (over 1 year ago)
- Language: C++
- Size: 169 KB
- Stars: 1
- Watchers: 10
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Oasis Digital Bazel examples
We use these examples to teach Bazel, but you are welcome to study them
for your own purposes!
https://oasisdigital.com/class/bazel
## C++ Bazel setup
From a Github comment:
"Bazel is a really hard sell compared to other build systems when it is
only usable in one IDE (CLion) and only on one operating system
(Linux)."
But things are not as tough as that commenter suggested - many orgs have
local tweaks to make the tools sufficient for lots of Real Work.
## IntelliJ (CLion) Bazel integration has trouble on Windows
https://github.com/bazelbuild/intellij/issues/113
## MacOS workaround for CLion
To work around the error "Warning:Unable to check compiler version ...",
https://github.com/bazelbuild/intellij/issues/1545
add this to your shell setup:
export DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer
## MacOS C/C++ debugging trouble
As of early 2022, debugging is broken by default for C/C++ on MacOS.
This issues describes the problem and links to several others.
https://github.com/bazelbuild/bazel/issues/6327
The problem can be worked around by disabling the sandbox, i.e. use the
local strategy:
build --spawn_strategy=local
Bazel does not consider the strategy as part of its cache key, so you may
need to clean the cache or change the source file to see this take effect.
Debugging then works in CLion.
The root cause is probably that nearly all Google developers work on Linux.