pw_assert: Reorganize backends for new pattern - Move all of the pw_assert_basic implementation into the pw_assert_basic.impl target. - Enable the require_link_deps check for pw_assert. Change-Id: Ie1f64cf0b7704a51710221d7ef02415c788a6235 Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/44100 Commit-Queue: Wyatt Hepler <hepler@google.com> Pigweed-Auto-Submit: Wyatt Hepler <hepler@google.com> Reviewed-by: Ewout van Bekkum <ewout@google.com>
diff --git a/pw_assert/BUILD.gn b/pw_assert/BUILD.gn index 7196831..258cd13 100644 --- a/pw_assert/BUILD.gn +++ b/pw_assert/BUILD.gn
@@ -61,8 +61,7 @@ ] public_deps = [ dir_pw_preprocessor ] - # TODO(pwbug/372): Update projects to properly list pw_assert:impl. - # require_link_deps = [ ":impl" ] + require_link_deps = [ ":impl" ] } # Provide "pw_assert/assert.h" in its own source set, so it can be used without
diff --git a/pw_assert_basic/BUILD.gn b/pw_assert_basic/BUILD.gn index b0a82da..3bb9023 100644 --- a/pw_assert_basic/BUILD.gn +++ b/pw_assert_basic/BUILD.gn
@@ -29,18 +29,6 @@ visibility = [ ":*" ] } -# These assert backend deps that might cause circular dependencies, since -# pw_assert is so ubiquitous. These deps are kept separate so they can be -# depended on from elsewhere. -# TODO(pwbug/372): Reorganize this. -group("pw_assert_basic.impl") { - public_deps = [ - dir_pw_result, - dir_pw_string, - dir_pw_sys_io, - ] -} - pw_facade("handler") { backend = pw_assert_basic_HANDLER_BACKEND public_configs = [ ":public_include_path" ] @@ -48,21 +36,35 @@ public = [ "public/pw_assert_basic/handler.h" ] } +# pw_assert_basic only provides the backend's interface. The implementation is +# pulled in through pw_build_LINK_DEPS. pw_source_set("pw_assert_basic") { public_configs = [ ":backend_config", ":public_include_path", ] - deps = [ - "$dir_pw_assert:facade", - "$dir_pw_preprocessor", - pw_assert_basic_HANDLER_BACKEND, - ] public = [ "public/pw_assert_basic/assert_basic.h", "public/pw_assert_basic/handler.h", "public_overrides/pw_assert_backend/assert_backend.h", ] +} + +# The assert backend deps that might cause circular dependencies, since +# pw_assert is so ubiquitous. These deps are kept separate so they can be +# depended on from elsewhere. +pw_source_set("pw_assert_basic.impl") { + public_deps = [ + dir_pw_result, + dir_pw_string, + dir_pw_sys_io, + ] + deps = [ + ":pw_assert_basic", + "$dir_pw_assert:facade", + "$dir_pw_preprocessor", + pw_assert_basic_HANDLER_BACKEND, + ] sources = [ "assert_basic.cc" ] }
diff --git a/pw_assert_log/BUILD.gn b/pw_assert_log/BUILD.gn index 46ce4c8..742c8be 100644 --- a/pw_assert_log/BUILD.gn +++ b/pw_assert_log/BUILD.gn
@@ -46,9 +46,8 @@ sources = [ "assert_log.cc" ] } -# TODO(pwbug/372): Reorganize this. -# pw_assert_log doesn't have deps with potential circular dependencies, so -# "deps" can be empty. +# pw_assert_log doesn't have deps with potential circular dependencies, so this +# impl group can be empty. group("pw_assert_log.impl") { }