| # Copyright (c) 2025 Project CHIP Authors | 
 | # | 
 | # Licensed under the Apache License, Version 2.0 (the "License"); | 
 | # you may not use this file except in compliance with the License. | 
 | # You may obtain a copy of the License at | 
 | # | 
 | # http://www.apache.org/licenses/LICENSE-2.0 | 
 | # | 
 | # Unless required by applicable law or agreed to in writing, software | 
 | # distributed under the License is distributed on an "AS IS" BASIS, | 
 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 
 | # See the License for the specific language governing permissions and | 
 | # limitations under the License. | 
 |  | 
 | import("//build_overrides/build.gni") | 
 | import("//build_overrides/chip.gni") | 
 |  | 
 | import("${chip_root}/build/chip/buildconfig_header.gni") | 
 | import("${chip_root}/build/chip/tests.gni") | 
 | import("${chip_root}/src/platform/device.gni") | 
 |  | 
 | declare_args() { | 
 |   # Extra header to include in NfcConfig.h for project. | 
 |   chip_nfc_project_config_include = "" | 
 | } | 
 |  | 
 | buildconfig_header("nfc_buildconfig") { | 
 |   header = "NfcBuildConfig.h" | 
 |   header_dir = "nfc" | 
 |  | 
 |   defines = [ | 
 |     "CONFIG_NETWORK_LAYER_NFC=${chip_enable_nfc_based_commissioning}", | 
 |     "CHIP_ENABLE_CHIPONFC_TEST=false", | 
 |   ] | 
 |  | 
 |   if (chip_nfc_project_config_include != "") { | 
 |     defines += | 
 |         [ "NFC_PROJECT_CONFIG_INCLUDE=${chip_nfc_project_config_include}" ] | 
 |   } | 
 |   if (chip_nfc_platform_config_include != "") { | 
 |     defines += | 
 |         [ "NFC_PLATFORM_CONFIG_INCLUDE=${chip_nfc_platform_config_include}" ] | 
 |   } | 
 | } | 
 |  | 
 | source_set("nfc_config_header") { | 
 |   sources = [ "NfcConfig.h" ] | 
 |  | 
 |   public_configs = [ "${chip_root}/src:includes" ] | 
 |  | 
 |   public_deps = [ | 
 |     ":nfc_buildconfig", | 
 |     "${chip_root}/src/platform:platform_buildconfig", | 
 |     "${chip_root}/src/system:system_config_header", | 
 |   ] | 
 | } | 
 |  | 
 | if (chip_enable_nfc_based_commissioning) { | 
 |   static_library("nfc") { | 
 |     output_name = "libNfcLayer" | 
 |  | 
 |     sources = [ "NfcApplicationDelegate.h" ] | 
 |  | 
 |     cflags = [ "-Wconversion" ] | 
 |  | 
 |     public_deps = [ | 
 |       ":nfc_config_header", | 
 |       "${chip_root}/src/inet", | 
 |       "${chip_root}/src/lib/support", | 
 |     ] | 
 |   } | 
 | } else { | 
 |   group("nfc") { | 
 |   } | 
 | } |