Add configuration setting for building YARA with profiling enabled using Bazel.
@@ -89,6 +89,9 @@ YARA_COPTS = YARA_MODULE_OPTS + select({
"-DHAVE_SCAN_PROC_IMPL=1",
],
"//conditions:default": ["-DUSE_NO_PROC"],
+}) + select({
+ ":yara_profiling_enabled": ["-DPROFILING_ENABLED"],
+ "//conditions:default": [],
}) + [
"-D_GNU_SOURCE",
# Tell the compiler we want the C99 standard.
@@ -98,6 +101,13 @@ YARA_COPTS = YARA_MODULE_OPTS + select({
"-Ilibyara/modules",
] + YARA_CONFIG_OPTS
+# Configuration setting for enabling profiling. Usage:
+# bazel build ... --define yara_profiling=enabled
+config_setting(
+ name = "yara_profiling_enabled",
+ values = {"define": "yara_profiling=enabled"},
+)
+
# Just YARA's error codes. This is useful for sandboxing as it avoids pulling
# in the whole library.
cc_library(
