Questions tagged [bazel-cpp]
48 questions
0
votes
0 answers
Is it possible to create a drop-in replacement for cc_library that generates test targets in bazel?
I have certain build targets which need to be build in two ways - one for my production application and one for my test code. I would like it if I only had to specify which targets had this requirement one time. For example, I have a macro that does…

Andrew King
- 145
- 10
0
votes
1 answer
How to get the previous bazel build logs in a decent Way?
Is there a better way of Command line option to get the last bazel build output log in a decent way?
I am trying this first time. I found nothing here as well https://bazel.build/external/extension
https://bazel.build/configure/attributes
Any idea…
0
votes
0 answers
Duplicate symbol with bazel build with envoy proxy
We customize envoy proxy by create a new filter. We are using envoy proxy with Version v1.21.2 and it build and link success fully without any problem.
Now we want to upgrade the envoy to latest version(which is v1.26.2). But after build…

van con Nguyen
- 101
- 1
- 5
0
votes
2 answers
Building OpenCV with rules_foreign_cc
I want to start a new project in C++ with Bazel. To build OpenCV I want to use foreign_rules_cc.
I have followed some tutorials, but I have not been able to build opencv successfully.
This is my WORKSPACE:
workspace(name =…

El_Loco
- 1,716
- 4
- 20
- 35
0
votes
0 answers
Bazel maintaining hermeticity building C++ with Clang on MacOS
Will preface by saying I am a beginner in bazel. I am attempting to use the newer toolchain mechanism (with --platforms) instead of the older crosstool_top mechanism. It seems the documentation…

LonelyLodge
- 3
- 2
0
votes
0 answers
Can I use Bazel Build for Fortify SCA scan of C++ app?
I am trying to scan a c++ project. I have multiple c++ files which I translated with sourceanalyzer -b file.cpp files.h which seemed to be done successfully but no output.
Tried the following:
When I try to -b …
0
votes
0 answers
customize cc_library to add params check
as per example
https://github.com/bazelbuild/examples/tree/main/configurations/cc_binary_selectable_copts
I would like to customize the cc_libarry
I wrote sample implementation
def _library_transition_rule_impl(ctx):
actual_library =…

Manish Singh
- 1
- 2
0
votes
0 answers
Need to prepend the Testwell CTC++ commands to the existing build system commands
I am trying to instrument the code coverage using bazel and testwell ctc++.
As per the documentation I understood I need to prepend the coomands of ctc++ to the build commands. so, I wrote an aspect function to add these but it is not working please…
0
votes
0 answers
access linkopts in rule
I have declared a simple
cc_binary(
name = "hello_world", srcs = ["hello_world.cpp"], linkopts = [ "-nostdlib",
])
I would like to access linkopts so that I can show some error message .
I have also implemented toolchain
def…

Manish Singh
- 1
- 2
0
votes
0 answers
Integrating cmake project into bazel monorepo
I'm playing around with bazel (rather new to it) and want to integrate one of my projects that needs to use cmake due to the use of JUCE.
I built a minimal example but I'm getting the error:
BUILD.bazel:5:6: output…

Roland Schützenhofer
- 21
- 1
- 3
0
votes
0 answers
Setting up (Remote) CLion IDE for C++ BAZEL project with protobufs & external libraries in a heavy git rep
I am new to C++ development and currently working in a company where both Python and C++ are used extensively, with a large git repository. I'm facing difficulties in correctly setting up the (Remote) CLion IDE for a C++ BAZEL project that involves…

SI-S
- 11
- 1
0
votes
0 answers
Query Bazel compilation target for compiler flags
How can I query Bazel for the compiler flags used to build a C/C++ target?

Sogartar
- 2,035
- 2
- 19
- 35
0
votes
0 answers
Getting Error variable not defined while sending cc_library's name as argument to python file demo.py through cmd in defined in genrule
Getting Error variable not defined while sending cc_library's name as argument to python file demo.py through cmd defined in genrule.
I want to pass cc_library's name(string) as argument to python file demo.py through cmd in defined in genrule. When…

Vasudev gowda
- 23
- 4
0
votes
0 answers
Error compiling pytorch as an external library with Bazel - C++
I'm working on using Bazel to compile the C++ distribution of pytorch as an external library. I used the process provided in the solution here and was able to setup libtorch as a external library/remote repository. My file directory follows that of…

t_perk
- 11
- 1
0
votes
0 answers
iOS PortSIP VoIP SDK with BAZEL build system
Has anyone managed to add framework to the BAZEL build system?
Im trying to add PortSIP framework and every time some fails
From the Bazel docs in the BUILD file I have to do like this
load("@build_bazel_rules_apple//apple:apple.bzl",…

WhileVG
- 21
- 5