| load("@rules_cc//cc:cc_binary.bzl", "cc_binary") | |
| load("//bazel:defs.bzl", "compatible_with_rp2") | |
| load("//bazel/util:transition.bzl", "extra_copts_for_all_deps") | |
| package(default_visibility = ["//visibility:public"]) | |
| # Only the baseline (no RTOS) variants are built here. The FreeRTOS variants need a kernel | |
| # that the Bazel build does not provide, and are CMake-only - see CMakeLists.txt. | |
| cc_binary( | |
| name = "sync_interop_test_actual", | |
| testonly = True, | |
| srcs = [ | |
| "interop_harness.c", | |
| "interop_harness.h", | |
| "interop_platform.c", | |
| "interop_platform.h", | |
| "interop_test_hook.h", | |
| "sync_interop_test.c", | |
| ], | |
| tags = ["manual"], # Built via sync_interop_test / sync_interop_test_sw. | |
| target_compatible_with = compatible_with_rp2(), | |
| deps = [ | |
| "//src/common/pico_sync", | |
| "//src/common/pico_time", | |
| "//src/rp2_common/hardware_clocks", | |
| "//src/rp2_common/pico_multicore", | |
| "//src/rp2_common/pico_stdlib", | |
| ], | |
| ) | |
| extra_copts_for_all_deps( | |
| name = "sync_interop_test", | |
| testonly = True, | |
| src = ":sync_interop_test_actual", | |
| extra_copts = [ | |
| "-DPICO_USE_SW_SPIN_LOCKS=0", | |
| # printf is instrumentation here, not the subject: the two disciplines are modelled | |
| # with the suite's own mutexes so no case depends on PICO_STDOUT_MUTEX. | |
| "-DPICO_STDOUT_MUTEX=0", | |
| ], | |
| target_compatible_with = compatible_with_rp2(), | |
| ) | |
| extra_copts_for_all_deps( | |
| name = "sync_interop_test_sw", | |
| testonly = True, | |
| src = ":sync_interop_test_actual", | |
| extra_copts = [ | |
| "-DPICO_USE_SW_SPIN_LOCKS=1", | |
| "-DPICO_STDOUT_MUTEX=0", | |
| ], | |
| target_compatible_with = ["//bazel/constraint:rp2350"], | |
| ) | |
| # Used only by the CMake FreeRTOS variants; listed so the file is accounted for. | |
| filegroup( | |
| name = "freertos_config", | |
| srcs = ["FreeRTOSConfig.h"], | |
| ) |