From 101608020e4c2a076f952e7680463c6cff1bf5d2 Mon Sep 17 00:00:00 2001 From: Sharad Binjola <31142146+sharadb-amazon@users.noreply.github.com> Date: Tue, 4 Apr 2023 15:29:01 -0700 Subject: [PATCH] Added build flag to allow/skip building Example Credential files (#25953) --- src/credentials/BUILD.gn | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/src/credentials/BUILD.gn b/src/credentials/BUILD.gn index 82cf18b6bc0fd7..da66062ad93dc2 100644 --- a/src/credentials/BUILD.gn +++ b/src/credentials/BUILD.gn @@ -17,6 +17,10 @@ import("//build_overrides/nlassert.gni") import("${chip_root}/src/crypto/crypto.gni") import("${chip_root}/src/platform/device.gni") +declare_args() { + chip_build_example_creds = true +} + static_library("credentials") { output_name = "libCredentials" @@ -47,16 +51,21 @@ static_library("credentials") { "attestation_verifier/DeviceAttestationDelegate.h", "attestation_verifier/DeviceAttestationVerifier.cpp", "attestation_verifier/DeviceAttestationVerifier.h", - "examples/DeviceAttestationCredsExample.cpp", - "examples/DeviceAttestationCredsExample.h", - "examples/ExampleDACs.cpp", - "examples/ExampleDACs.h", - "examples/ExamplePAI.cpp", - "examples/ExamplePAI.h", - "examples/LastKnownGoodTimeCertificateValidityPolicyExample.h", - "examples/StrictCertificateValidityPolicyExample.h", ] + if (chip_build_example_creds) { + sources += [ + "examples/DeviceAttestationCredsExample.cpp", + "examples/DeviceAttestationCredsExample.h", + "examples/ExampleDACs.cpp", + "examples/ExampleDACs.h", + "examples/ExamplePAI.cpp", + "examples/ExamplePAI.h", + "examples/LastKnownGoodTimeCertificateValidityPolicyExample.h", + "examples/StrictCertificateValidityPolicyExample.h", + ] + } + # TODO: These tests files should be removed after the DeviceAttestationCredsExample implementation # is changed to generate it's own credentials instead of using Test credentials. # For some platforms test builds, which are bilding monolithic test library these files are not needed.