[build] fix Linux and Darwin builds when chip_enable_ble=false (#3179) (#3238)
diff --git a/src/BUILD.gn b/src/BUILD.gn
index 1aab88a..5883684 100644
--- a/src/BUILD.gn
+++ b/src/BUILD.gn
@@ -27,8 +27,8 @@
defines = [ "CHIP_SEPARATE_CONFIG_H=1" ]
- if (current_os == "linux") {
- defines += [ "CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE=1" ]
+ if (chip_device_platform == "linux" || chip_device_platform == "darwin") {
+ defines += [ "CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE=${chip_enable_ble}" ]
}
}
diff --git a/src/platform/Darwin/CHIPDevicePlatformConfig.h b/src/platform/Darwin/CHIPDevicePlatformConfig.h
index ee2f929..142bc09 100644
--- a/src/platform/Darwin/CHIPDevicePlatformConfig.h
+++ b/src/platform/Darwin/CHIPDevicePlatformConfig.h
@@ -30,7 +30,9 @@
#define CHIP_DEVICE_CONFIG_ENABLE_THREAD 0
+#ifndef CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE
#define CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE 1
+#endif
#define CHIP_DEVICE_CONFIG_ENABLE_CHIP_TIME_SERVICE_TIME_SYNC 0