I would like to build cockroach DB with CFLAGS += -O
, CXXFLAGS += -O
and
LDFLAGS ?= -static
. How would I do that?
Asked
Active
Viewed 46 times
3

RCX
- 61
- 7
1 Answers
3
There are a couple of ways to do that.
(1) If you are building with make
. You can simple open the make file and just find and override these flags.
(2) If you are building with bazel
. You can set these flags with these bazel command options: --cxxopt=-O
, --copt=-O
, --linkopt=-static
. For example: bazel build pkg/cmd/cockroach-oss --cxxopt=-O --copt=-O --linkopt=-static
(3) If you are building with crdb's dev
tool (a wrapper of bazel). You can pass in the same options as (2) but following an extra --
. For example, dev build oss -- --cxxopt=-O --copt=-O --linkopt=-static

RCX
- 61
- 7