From 99e59410a5a96bc6f393a8e150d80d5c746af70d Mon Sep 17 00:00:00 2001 From: Sharad Binjola Date: Mon, 3 Apr 2023 16:53:23 -0700 Subject: [PATCH] Added build flag to allow/skip building Example Credential files --- 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.