mirror of
https://github.com/CrowCpp/Crow.git
synced 2026-01-18 16:31:17 +01:00
keeping bazel local and adding options for compression and ssl
This commit is contained in:
committed by
gittiver
parent
a70f4f265c
commit
6eb561bd50
6
.github/workflows/build_bazel.yml
vendored
6
.github/workflows/build_bazel.yml
vendored
@@ -1,4 +1,4 @@
|
||||
name: Build and test
|
||||
name: bazel - Build and test
|
||||
|
||||
on:
|
||||
push:
|
||||
@@ -35,7 +35,6 @@ jobs:
|
||||
if [ "$RUNNER_OS" == "Linux" ]; then
|
||||
curl --tlsv1.2 --proto =https -Lo bazel https://github.com/bazelbuild/bazelisk/releases/download/v1.25.0/bazelisk-linux-amd64
|
||||
chmod +x bazel
|
||||
sudo mv bazel /usr/bin/
|
||||
|
||||
sudo apt-get update && \
|
||||
sudo apt-get install -yq \
|
||||
@@ -45,7 +44,6 @@ jobs:
|
||||
elif [ "$RUNNER_OS" == "macOS" ]; then
|
||||
curl --tlsv1.2 --proto =https -Lo bazel https://github.com/bazelbuild/bazelisk/releases/download/v1.25.0/bazelisk-darwin-amd64
|
||||
chmod +x bazel
|
||||
sudo mv bazel /usr/bin/
|
||||
|
||||
brew install asio openssl zlib
|
||||
else
|
||||
@@ -55,6 +53,6 @@ jobs:
|
||||
shell: bash
|
||||
|
||||
- name: Build bazel
|
||||
run: bazel build //...
|
||||
run: ./bazel build //...
|
||||
|
||||
|
||||
|
||||
45
BUILD.bazel
45
BUILD.bazel
@@ -1,7 +1,48 @@
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
load("@bazel_skylib//rules:common_settings.bzl", "bool_flag")
|
||||
|
||||
bool_flag(
|
||||
name = "ssl_enabled_flag",
|
||||
build_setting_default = True,
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
|
||||
config_setting(
|
||||
name = "ssl_enabled",
|
||||
flag_values = {
|
||||
"//:ssl_enabled_flag": "True",
|
||||
},
|
||||
)
|
||||
|
||||
bool_flag(
|
||||
name = "compression_enabled_flag",
|
||||
build_setting_default = True,
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
|
||||
config_setting(
|
||||
name = "compression_enabled",
|
||||
flag_values = {
|
||||
"//:compression_enabled_flag": "True",
|
||||
},
|
||||
)
|
||||
|
||||
cc_library(
|
||||
name = "crow",
|
||||
hdrs = glob(["include/**/*"]),
|
||||
includes = ["include"],
|
||||
visibility = ["//visibility:public"],
|
||||
copts = ["-DCROW_ENABLE_SSL"]
|
||||
copts = select({
|
||||
":ssl_enabled": ["-DASIO_STANDALONE", "-DCROW_ENABLE_SSL"],
|
||||
"//conditions:default": [],
|
||||
}) + select({
|
||||
":compression_enabled": ["-DCROW_ENABLE_COMPRESSION"],
|
||||
"//conditions:default": [],
|
||||
}),
|
||||
deps = select({
|
||||
":ssl_enabled": ["@asio//:asio"],
|
||||
"//conditions:default": [],
|
||||
}) + select({
|
||||
":compression_enabled": ["@zlib//:zlib"],
|
||||
"//conditions:default": [],
|
||||
}),
|
||||
)
|
||||
|
||||
@@ -1,2 +1,6 @@
|
||||
module(name = "crowcpp", version = "1.0")
|
||||
bazel_dep(name = "rules_cc", version = "0.1.1")
|
||||
|
||||
bazel_dep(name = "bazel_skylib", version = "1.7.1")
|
||||
bazel_dep(name = "rules_cc", version = "0.1.1")
|
||||
bazel_dep(name = "zlib", version = "1.3.1.bcr.5")
|
||||
bazel_dep(name = "asio", version = "1.32.0")
|
||||
Reference in New Issue
Block a user