Define Linux clang target as toolchain
This change configures the Linux clang -Og target as a toolchain with
args. To support this, all Pigweed variables from pw_vars_default are
made into build args, defined within their respective modules.
The Linux clang target/toolchain is the only one that currently works.
Pigweed's other targets will be ported in later changes.
Change-Id: I051e29fde7577e41a3184c37031a4e04936404e1
diff --git a/pw_assert/BUILD.gn b/pw_assert/BUILD.gn
index db3c184..417e0b2 100644
--- a/pw_assert/BUILD.gn
+++ b/pw_assert/BUILD.gn
@@ -15,16 +15,20 @@
# gn-format disable
import("//build_overrides/pigweed.gni")
-import("$dir_pigweed/legacy_target.gni")
import("$dir_pw_build/facade.gni")
import("$dir_pw_docgen/docs.gni")
import("$dir_pw_unit_test/test.gni")
+declare_args() {
+ # Backend for the pw_assert module.
+ pw_assert_BACKEND = ""
+}
+
config("default_config") {
include_dirs = [ "public" ]
}
pw_facade("pw_assert") {
- backend = dir_pw_assert_backend
+ backend = pw_assert_BACKEND
public_configs = [ ":default_config" ]
public = [
"public/pw_assert/assert.h",
@@ -54,15 +58,15 @@
deps = [ dir_pw_status ]
# TODO(frolv): Fix this test on the QEMU target.
- enable_if = pw_executable_config.target_type != "lm3s6965evb_executable"
+ enable_if = pw_build_EXECUTABLE_TARGET_TYPE != "lm3s6965evb_executable"
}
pw_test("assert_backend_compile_test") {
- enable_if = dir_pw_assert_backend != ""
+ enable_if = pw_assert_BACKEND != ""
deps = [
":pw_assert",
- dir_pw_assert_backend,
dir_pw_status,
+ pw_assert_BACKEND,
]
sources = [
"assert_backend_compile_test.c",