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.