6 ms·
You could build with bazel, which ships compiler configs for clang and gcc on linux (among other combinations) in its "CROSSTOOL"[1] file. Then it's trivial to
by ebikelaw 8y ago
You could build with bazel, which ships compiler configs for clang and gcc on linux (among other combinations) in its "CROSSTOOL"[1] file. Then it's trivial to switch compilers with one argument. This feature is a result of Google's years-long support of both GCC and clang for its own build, test, and release.
$ bazel build --compiler=my_favorite_compiler //my/fine:program
1: https://github.com/bazelbuild/bazel/wiki/Building-with-a-custom-toolchain https://github.com/bazelbuild/bazel/wiki/Building-with-a-cus...
- HelloNurse 8y agoSorry, I lost you at "bazel". Do you believe constructing clang command lines in addition to gcc command lines is harder than setting up a particularly complex build tool like Bazel? Not to mention that it doesn't appear to support GCC and Clang on Windows.
- ebikelaw 8y agoBazel comes with an installer package that you click and run. I didn't find it that complicated. It comes out of the box with CROSSTOOL support for GCC, clang, and MSVC on Windows, among dozens of other toolchains. https://github.com/bazelbuild/bazel/blob/master/tools/cpp/CROSSTOOL https://github.com/bazelbuild/bazel/blob/master/tools/cpp/CR...
- HelloNurse 8y agoThe official documentation at https://docs.bazel.build/versions/master/windows.html https://docs.bazel.build/versions/master/windows.html says: Build C++ To build C++ targets, you need: •The Visual C++ compiler. Whether the developers gave up on the Mingw64 GCC and Clang toolchains or it's a documentation mistake, this statement places Bazel support for Windows in the "don't touch with a 10' pole" category. But my point was that adopting Bazel is obviously far more complex than adapting existing build scripts and build script generators for Make, Cmake, Ninja etc to use Clang.