pw_data_link: Only build on Linux
Building on Mac fails due to missing sys/epoll.h which is linux only.
Change-Id: I81e9cfd39a9e44d214574ff622aad3d029f01722
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/experimental/+/193650
Commit-Queue: Anthony DiGirolamo <tonymd@google.com>
Reviewed-by: Rob Mohr <mohrr@google.com>
diff --git a/pw_data_link/BUILD.gn b/pw_data_link/BUILD.gn
index 7da71a6..247dd1a 100644
--- a/pw_data_link/BUILD.gn
+++ b/pw_data_link/BUILD.gn
@@ -79,20 +79,26 @@
]
}
-pw_executable("sample_app") {
- sources = [ "sample_app.cc" ]
- deps = [
- ":data_link",
- ":data_link_thread",
- ":server_socket",
- ":socket_data_link",
- "$dir_pw_allocator:simple_allocator",
- "$dir_pw_assert",
- "$dir_pw_log",
- "$dir_pw_sync:thread_notification",
- "$dir_pw_thread:thread",
- "$dir_pw_thread:thread_core",
- ]
+# pw_data_link requires Linux sys/epoll.h
+if (host_os == "linux") {
+ pw_executable("sample_app") {
+ sources = [ "sample_app.cc" ]
+ deps = [
+ ":data_link",
+ ":data_link_thread",
+ ":server_socket",
+ ":socket_data_link",
+ "$dir_pw_allocator:simple_allocator",
+ "$dir_pw_assert",
+ "$dir_pw_log",
+ "$dir_pw_sync:thread_notification",
+ "$dir_pw_thread:thread",
+ "$dir_pw_thread:thread_core",
+ ]
+ }
+} else {
+ group("sample_app") {
+ }
}
pw_test("data_link_test") {
@@ -117,8 +123,13 @@
}
pw_test_group("tests") {
- tests = [
- ":data_link_test",
- ":socket_data_link_test",
- ]
+ tests = []
+
+ # pw_data_link requires Linux sys/epoll.h
+ if (host_os == "linux") {
+ tests += [
+ ":data_link_test",
+ ":socket_data_link_test",
+ ]
+ }
}