summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAustin S. Hemmelgarn <austin@netdata.cloud>2024-04-17 07:02:51 -0400
committerGitHub <noreply@github.com>2024-04-17 07:02:51 -0400
commitcee3533b4d148bebd623e8c8c4dbf3d9687ca15d (patch)
tree1aac1086ffeace67200b0306d21508dc74e15996
parent5a55f88a5e36e450dade400f32e0385940c7987a (diff)
Add a build option to disable all optional features by default. (#17309)
This is intended as a way for developers to quickly turn off everything except the part of the agent that they are actually working on, allowing for much simpler CMake command lines when debugging isolated changes to the build system.
-rw-r--r--CMakeLists.txt47
1 files changed, 26 insertions, 21 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 155e21b189..4d27656b55 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -94,30 +94,35 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS On)
set(CONFIG_H_DIR ${CMAKE_BINARY_DIR})
set(CONFIG_H ${CONFIG_H_DIR}/config.h)
-option(ENABLE_CLOUD "enable cloud" True)
-option(ENABLE_ACLK "enable aclk" True)
-option(ENABLE_ML "enable machine learning" True)
+# This is intended to make life easier for developers who are working on one
+# specific feature.
+option(DEFAULT_FEATURE_STATE "specify the default state for optional features" True)
+mark_as_advanced(DEFAULT_FEATURE_STATE)
+
+option(ENABLE_CLOUD "enable cloud" ${DEFAULT_FEATURE_STATE})
+option(ENABLE_ACLK "enable aclk" ${DEFAULT_FEATURE_STATE})
+option(ENABLE_ML "enable machine learning" ${DEFAULT_FEATURE_STATE})
option(ENABLE_H2O "enable h2o" True)
option(ENABLE_DBENGINE "enable dbengine" True)
-option(ENABLE_PLUGIN_APPS "enable apps.plugin" True)
-option(ENABLE_PLUGIN_CGROUP_NETWORK "enable cgroup-network plugin" True)
-option(ENABLE_PLUGIN_CUPS "enable cups.plugin" True)
-option(ENABLE_PLUGIN_DEBUGFS "enable debugfs.plugin" True)
-option(ENABLE_PLUGIN_EBPF "enable ebpf.plugin" True)
-option(ENABLE_PLUGIN_FREEIPMI "enable freeipmi.plugin" True)
-option(ENABLE_PLUGIN_GO "enable go.d.plugin" True)
-option(ENABLE_PLUGIN_LOCAL_LISTENERS "enable local-listeners" True)
-option(ENABLE_PLUGIN_LOGS_MANAGEMENT "enable logs-management.plugin" True)
-option(ENABLE_PLUGIN_NETWORK_VIEWER "enable network-viewer" True)
-option(ENABLE_PLUGIN_NFACCT "enable nfacct.plugin" True)
-option(ENABLE_PLUGIN_PERF "enable perf.plugin" True)
-option(ENABLE_PLUGIN_SLABINFO "enable slabinfo.plugin" True)
-option(ENABLE_PLUGIN_SYSTEMD_JOURNAL "enable systemd-journal.plugin" True)
-option(ENABLE_PLUGIN_XENSTAT "enable xenstat.plugin" True)
-
-option(ENABLE_EXPORTER_PROMETHEUS_REMOTE_WRITE "enable prometheus remote write exporter" True)
-option(ENABLE_EXPORTER_MONGODB "enable mongodb exporter" True)
+option(ENABLE_PLUGIN_APPS "enable apps.plugin" ${DEFAULT_FEATURE_STATE})
+option(ENABLE_PLUGIN_CGROUP_NETWORK "enable cgroup-network plugin" ${DEFAULT_FEATURE_STATE})
+option(ENABLE_PLUGIN_CUPS "enable cups.plugin" ${DEFAULT_FEATURE_STATE})
+option(ENABLE_PLUGIN_DEBUGFS "enable debugfs.plugin" ${DEFAULT_FEATURE_STATE})
+option(ENABLE_PLUGIN_EBPF "enable ebpf.plugin" ${DEFAULT_FEATURE_STATE})
+option(ENABLE_PLUGIN_FREEIPMI "enable freeipmi.plugin" ${DEFAULT_FEATURE_STATE})
+option(ENABLE_PLUGIN_GO "enable go.d.plugin" ${DEFAULT_FEATURE_STATE})
+option(ENABLE_PLUGIN_LOCAL_LISTENERS "enable local-listeners" ${DEFAULT_FEATURE_STATE})
+option(ENABLE_PLUGIN_LOGS_MANAGEMENT "enable logs-management.plugin" ${DEFAULT_FEATURE_STATE})
+option(ENABLE_PLUGIN_NETWORK_VIEWER "enable network-viewer" ${DEFAULT_FEATURE_STATE})
+option(ENABLE_PLUGIN_NFACCT "enable nfacct.plugin" ${DEFAULT_FEATURE_STATE})
+option(ENABLE_PLUGIN_PERF "enable perf.plugin" ${DEFAULT_FEATURE_STATE})
+option(ENABLE_PLUGIN_SLABINFO "enable slabinfo.plugin" ${DEFAULT_FEATURE_STATE})
+option(ENABLE_PLUGIN_SYSTEMD_JOURNAL "enable systemd-journal.plugin" ${DEFAULT_FEATURE_STATE})
+option(ENABLE_PLUGIN_XENSTAT "enable xenstat.plugin" ${DEFAULT_FEATURE_STATE})
+
+option(ENABLE_EXPORTER_PROMETHEUS_REMOTE_WRITE "enable prometheus remote write exporter" ${DEFAULT_FEATURE_STATE})
+option(ENABLE_EXPORTER_MONGODB "enable mongodb exporter" ${DEFAULT_FEATURE_STATE})
option(ENABLE_BUNDLED_JSONC "enable bundled json-c" False)
option(ENABLE_BUNDLED_YAML "enable bundled yaml" False)