forked from openvinotoolkit/model_server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
common_settings.bzl
91 lines (91 loc) · 2.78 KB
/
common_settings.bzl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
#
# Copyright (c) 2024 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
###############################
# bazel config settings
###############################
#To build without mediapipe use flags - bazel build --define MEDIAPIPE_DISABLE=1 --cxxopt=-DMEDIAPIPE_DISABLE=1 //src:ovms
load("@bazel_skylib//lib:selects.bzl", "selects")
load("@mediapipe//mediapipe/framework:more_selects.bzl", "more_selects")
load("@bazel_skylib//rules:common_settings.bzl", "string_flag")
load("//:distro.bzl", "distro_flag")
def create_config_settings():
distro_flag()
native.config_setting(
name = "disable_mediapipe",
define_values = {
"MEDIAPIPE_DISABLE": "1",
},
visibility = ["//visibility:public"],
)
more_selects.config_setting_negation(
name = "not_disable_mediapipe",
negate = ":disable_mediapipe",
)
#To build without python use flags - bazel build --define PYTHON_DISABLE=1 //src:ovms
native.config_setting(
name = "disable_python",
define_values = {
"PYTHON_DISABLE": "1",
},
visibility = ["//visibility:public"],
)
more_selects.config_setting_negation(
name = "not_disable_python",
negate = ":disable_python",
)
native.config_setting(
name = "fuzzer_build",
define_values = {
"FUZZER_BUILD": "1",
},
visibility = ["//visibility:public"],
)
more_selects.config_setting_negation(
name = "not_fuzzer_build",
negate = ":fuzzer_build",
)
###############################
# compilation settings
###############################
COMMON_STATIC_LIBS_COPTS = [
"-Wall",
"-Wno-unknown-pragmas",
"-Wno-sign-compare",
"-fvisibility=hidden", # Needed for pybind targets
"-Werror",
]
COMMON_STATIC_LIBS_LINKOPTS = [
"-lxml2",
"-luuid",
"-lstdc++fs",
"-lcrypto",
]
COMMON_FUZZER_COPTS = [
"-fsanitize=address",
"-fprofile-generate",
"-ftest-coverage",
]
COMMON_FUZZER_LINKOPTS = [
"-fprofile-generate",
"-fsanitize=address",
"-fsanitize-coverage=trace-pc",
"-static-libasan",
]
COMMON_LOCAL_DEFINES = ["SPDLOG_ACTIVE_LEVEL=SPDLOG_LEVEL_TRACE"]
PYBIND_DEPS = [
"@python3_linux//:python3-lib",
"@pybind11//:pybind11_embed",
]