Skip to content

Commit

Permalink
Chore: rework Bazel build system
Browse files Browse the repository at this point in the history
  • Loading branch information
hcoona committed Dec 29, 2021
1 parent 7949ba4 commit 392ecc0
Show file tree
Hide file tree
Showing 50 changed files with 1,951 additions and 668 deletions.
35 changes: 26 additions & 9 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,29 @@
# See the License for the specific language governing permissions and
# limitations under the License.

build --copt -DHAVE_ZLIB=1
# bazel build with glog
# build --define=with_glog=true
build -c opt
build --incompatible_disable_deprecated_attr_params=false
build --incompatible_new_actions_api=false
# unittest
test --define=unittest=true
test --copt=-g
#
# Default build options. These are applied first and unconditionally.
#

build --cxxopt="-std=c++11"
# Use gnu11 for asm keyword.
build --conlyopt="-std=gnu11"

# Enable position independent code (this is the default on macOS and Windows)
# (Workaround for https://github.com/bazelbuild/rules_foreign_cc/issues/421)
build --copt=-fPIC
build --fission=dbg,opt
build --features=per_object_debug_info

# We already have absl in the build, define absl=1 to tell googletest to use absl for backtrace.
build --define absl=1

# For brpc.
build --define=BRPC_WITH_GLOG=true
test --define=BRPC_BUILD_FOR_UNITTEST=true

# Pass PATH, CC, CXX and LLVM_CONFIG variables from the environment.
build --action_env=CC
build --action_env=CXX
build --action_env=LLVM_CONFIG
build --action_env=PATH
1 change: 1 addition & 0 deletions .bazelversion
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
4.2.2
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ before_script:
- sudo bash -c "echo 'core.%e.%p' > /proc/sys/kernel/core_pattern"

before_install:
- wget --no-clobber https://github.com/bazelbuild/bazel/releases/download/0.25.1/bazel_0.25.1-linux-x86_64.deb && sudo dpkg -i bazel_0.25.1-linux-x86_64.deb
- wget --no-clobber https://github.com/bazelbuild/bazel/releases/download/4.2.2/bazel_4.2.2-linux-x86_64.deb && sudo dpkg -i bazel_4.2.2-linux-x86_64.deb
- sudo apt-get install automake bison flex g++ git libboost-all-dev libevent-dev libssl-dev libtool make pkg-config # thrift dependencies
- wget http://www.apache.org/dist/thrift/0.11.0/thrift-0.11.0.tar.gz && tar -xf thrift-0.11.0.tar.gz && cd thrift-0.11.0/ && ./configure --prefix=/usr --with-rs=no --with-ruby=no --with-python=no --with-java=no --with-go=no --with-perl=no --with-php=no --with-csharp=no --with-erlang=no --with-lua=no --with-nodejs=no CXXFLAGS="-Wno-unused-variable" && make -j4 && sudo make install && cd -

Expand Down
Loading

0 comments on commit 392ecc0

Please sign in to comment.