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.
Austin S. Hemmelgarn committed
Apr 17, 2024 at 07:02 UTC
cee3533b4d148bebd623e8c8c4dbf3d9687ca15d
1 file changed
+26
-21
CMakeLists.txt
+26
-21
@@ -94,30 +94,35 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS On)
94
set(CONFIG_H_DIR ${CMAKE_BINARY_DIR})
95
set(CONFIG_H ${CONFIG_H_DIR}/config.h)
96
97
-option(ENABLE_CLOUD "enable cloud" True)
98
-option(ENABLE_ACLK "enable aclk" True)
99
-option(ENABLE_ML "enable machine learning" True)
97
+# This is intended to make life easier for developers who are working on one
98
+# specific feature.
99
+option(DEFAULT_FEATURE_STATE "specify the default state for optional features" True)
100
+mark_as_advanced(DEFAULT_FEATURE_STATE)
101
+
102
+option(ENABLE_CLOUD "enable cloud" ${DEFAULT_FEATURE_STATE})
103
+option(ENABLE_ACLK "enable aclk" ${DEFAULT_FEATURE_STATE})
104
+option(ENABLE_ML "enable machine learning" ${DEFAULT_FEATURE_STATE})
105
option(ENABLE_H2O "enable h2o" True)
106
option(ENABLE_DBENGINE "enable dbengine" True)
107
103
-option(ENABLE_PLUGIN_APPS "enable apps.plugin" True)
104
-option(ENABLE_PLUGIN_CGROUP_NETWORK "enable cgroup-network plugin" True)
105
-option(ENABLE_PLUGIN_CUPS "enable cups.plugin" True)
106
-option(ENABLE_PLUGIN_DEBUGFS "enable debugfs.plugin" True)
107
-option(ENABLE_PLUGIN_EBPF "enable ebpf.plugin" True)
108
-option(ENABLE_PLUGIN_FREEIPMI "enable freeipmi.plugin" True)
109
-option(ENABLE_PLUGIN_GO "enable go.d.plugin" True)
110
-option(ENABLE_PLUGIN_LOCAL_LISTENERS "enable local-listeners" True)
111
-option(ENABLE_PLUGIN_LOGS_MANAGEMENT "enable logs-management.plugin" True)
112
-option(ENABLE_PLUGIN_NETWORK_VIEWER "enable network-viewer" True)
113
-option(ENABLE_PLUGIN_NFACCT "enable nfacct.plugin" True)
114
-option(ENABLE_PLUGIN_PERF "enable perf.plugin" True)
115
-option(ENABLE_PLUGIN_SLABINFO "enable slabinfo.plugin" True)
116
-option(ENABLE_PLUGIN_SYSTEMD_JOURNAL "enable systemd-journal.plugin" True)
117
-option(ENABLE_PLUGIN_XENSTAT "enable xenstat.plugin" True)
118
-
119
-option(ENABLE_EXPORTER_PROMETHEUS_REMOTE_WRITE "enable prometheus remote write exporter" True)
120
-option(ENABLE_EXPORTER_MONGODB "enable mongodb exporter" True)
108
+option(ENABLE_PLUGIN_APPS "enable apps.plugin" ${DEFAULT_FEATURE_STATE})
109
+option(ENABLE_PLUGIN_CGROUP_NETWORK "enable cgroup-network plugin" ${DEFAULT_FEATURE_STATE})
110
+option(ENABLE_PLUGIN_CUPS "enable cups.plugin" ${DEFAULT_FEATURE_STATE})
111
+option(ENABLE_PLUGIN_DEBUGFS "enable debugfs.plugin" ${DEFAULT_FEATURE_STATE})
112
+option(ENABLE_PLUGIN_EBPF "enable ebpf.plugin" ${DEFAULT_FEATURE_STATE})
113
+option(ENABLE_PLUGIN_FREEIPMI "enable freeipmi.plugin" ${DEFAULT_FEATURE_STATE})
114
+option(ENABLE_PLUGIN_GO "enable go.d.plugin" ${DEFAULT_FEATURE_STATE})
115
+option(ENABLE_PLUGIN_LOCAL_LISTENERS "enable local-listeners" ${DEFAULT_FEATURE_STATE})
116
+option(ENABLE_PLUGIN_LOGS_MANAGEMENT "enable logs-management.plugin" ${DEFAULT_FEATURE_STATE})
117
+option(ENABLE_PLUGIN_NETWORK_VIEWER "enable network-viewer" ${DEFAULT_FEATURE_STATE})
118
+option(ENABLE_PLUGIN_NFACCT "enable nfacct.plugin" ${DEFAULT_FEATURE_STATE})
119
+option(ENABLE_PLUGIN_PERF "enable perf.plugin" ${DEFAULT_FEATURE_STATE})
120
+option(ENABLE_PLUGIN_SLABINFO "enable slabinfo.plugin" ${DEFAULT_FEATURE_STATE})
121
+option(ENABLE_PLUGIN_SYSTEMD_JOURNAL "enable systemd-journal.plugin" ${DEFAULT_FEATURE_STATE})
122
+option(ENABLE_PLUGIN_XENSTAT "enable xenstat.plugin" ${DEFAULT_FEATURE_STATE})
123
+
124
+option(ENABLE_EXPORTER_PROMETHEUS_REMOTE_WRITE "enable prometheus remote write exporter" ${DEFAULT_FEATURE_STATE})
125
+option(ENABLE_EXPORTER_MONGODB "enable mongodb exporter" ${DEFAULT_FEATURE_STATE})
126
127
option(ENABLE_BUNDLED_JSONC "enable bundled json-c" False)
128
option(ENABLE_BUNDLED_YAML "enable bundled yaml" False)