Skip to content

Commit

Permalink
Add #if CHIP_HAVE_CONFIG around *BuildConfig headers (#21169)
Browse files Browse the repository at this point in the history
* Add #if CHIP_HAVE_CONFIG around *BuildConfig headers

find ./ -name "*.h" -o -name "*.cpp" -exec sed -i "s/\(#include <app\/AppBuildConfig\.h>\)/#if CHIP_HAVE_CONFIG_H\n\1\n#endif/g" {} +

Manually for a few instances of CHIPDeviceBuildConfig.h and
CHIPAdditionalDataPayloadBuildConfig.h

* Add AppConfig.h and move build config check in there

Reverted #if CHIP_HAVE_CONFIG and replaced includes:
find ./ -name "*.h" -o -name "*.cpp" -exec sed -i "s/\(#include <app\/AppBuildConfig\.h>\)/#include <app\/AppConfig\.h>/g" {} +

* Restyled by gn

Co-authored-by: Restyled.io <[email protected]>
  • Loading branch information
2 people authored and pull[bot] committed Feb 23, 2024
1 parent b0dd1d1 commit 8484873
Show file tree
Hide file tree
Showing 56 changed files with 91 additions and 56 deletions.
2 changes: 1 addition & 1 deletion src/access/AccessControl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
// Included for the default AccessControlDelegate logging enables/disables.
// See `chip_access_control_policy_logging_verbosity` in `src/app/BUILD.gn` for
// the levels available.
#include <app/AppBuildConfig.h>
#include <app/AppConfig.h>

#include "AccessControl.h"

Expand Down
22 changes: 22 additions & 0 deletions src/app/AppConfig.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
*
* Copyright (c) 2020-2022 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.
*/

#pragma once

#if CHIP_HAVE_CONFIG_H
#include <app/AppBuildConfig.h>
#endif
8 changes: 7 additions & 1 deletion src/app/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ buildconfig_header("app_buildconfig") {
]
}

source_set("app_config") {
sources = [ "AppConfig.h" ]

public_deps = [ ":app_buildconfig" ]
}

static_library("app") {
output_name = "libCHIPDataModel"

Expand Down Expand Up @@ -179,7 +185,7 @@ static_library("app") {
]

public_deps = [
":app_buildconfig",
":app_config",
"${chip_root}/src/access",
"${chip_root}/src/lib/address_resolve",
"${chip_root}/src/lib/support",
Expand Down
2 changes: 1 addition & 1 deletion src/app/MessageDef/AttributeDataIB.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include <stdarg.h>
#include <stdio.h>

#include <app/AppBuildConfig.h>
#include <app/AppConfig.h>

namespace chip {
namespace app {
Expand Down
2 changes: 1 addition & 1 deletion src/app/MessageDef/AttributeDataIBs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#include <stdarg.h>
#include <stdio.h>

#include <app/AppBuildConfig.h>
#include <app/AppConfig.h>

using namespace chip;
using namespace chip::TLV;
Expand Down
2 changes: 1 addition & 1 deletion src/app/MessageDef/AttributePathIB.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#include <stdarg.h>
#include <stdio.h>

#include <app/AppBuildConfig.h>
#include <app/AppConfig.h>
#include <app/data-model/Encode.h>
#include <app/data-model/Nullable.h>

Expand Down
2 changes: 1 addition & 1 deletion src/app/MessageDef/AttributePathIBs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#include <stdarg.h>
#include <stdio.h>

#include <app/AppBuildConfig.h>
#include <app/AppConfig.h>

namespace chip {
namespace app {
Expand Down
2 changes: 1 addition & 1 deletion src/app/MessageDef/AttributeReportIB.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include <stdarg.h>
#include <stdio.h>

#include <app/AppBuildConfig.h>
#include <app/AppConfig.h>

namespace chip {
namespace app {
Expand Down
2 changes: 1 addition & 1 deletion src/app/MessageDef/AttributeReportIBs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#include <stdarg.h>
#include <stdio.h>

#include <app/AppBuildConfig.h>
#include <app/AppConfig.h>

namespace chip {
namespace app {
Expand Down
2 changes: 1 addition & 1 deletion src/app/MessageDef/AttributeStatusIB.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#include <stdarg.h>
#include <stdio.h>

#include <app/AppBuildConfig.h>
#include <app/AppConfig.h>

namespace chip {
namespace app {
Expand Down
2 changes: 1 addition & 1 deletion src/app/MessageDef/AttributeStatusIBs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include <stdarg.h>
#include <stdio.h>

#include <app/AppBuildConfig.h>
#include <app/AppConfig.h>

namespace chip {
namespace app {
Expand Down
2 changes: 1 addition & 1 deletion src/app/MessageDef/ClusterPathIB.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include <stdarg.h>
#include <stdio.h>

#include <app/AppBuildConfig.h>
#include <app/AppConfig.h>

namespace chip {
namespace app {
Expand Down
2 changes: 1 addition & 1 deletion src/app/MessageDef/CommandDataIB.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include <stdarg.h>
#include <stdio.h>

#include <app/AppBuildConfig.h>
#include <app/AppConfig.h>

namespace chip {
namespace app {
Expand Down
2 changes: 1 addition & 1 deletion src/app/MessageDef/CommandPathIB.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include <stdarg.h>
#include <stdio.h>

#include <app/AppBuildConfig.h>
#include <app/AppConfig.h>

using namespace chip;
using namespace chip::TLV;
Expand Down
2 changes: 1 addition & 1 deletion src/app/MessageDef/CommandStatusIB.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#include <stdarg.h>
#include <stdio.h>

#include <app/AppBuildConfig.h>
#include <app/AppConfig.h>

namespace chip {
namespace app {
Expand Down
2 changes: 1 addition & 1 deletion src/app/MessageDef/DataVersionFilterIB.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#include <stdarg.h>
#include <stdio.h>

#include <app/AppBuildConfig.h>
#include <app/AppConfig.h>

namespace chip {
namespace app {
Expand Down
2 changes: 1 addition & 1 deletion src/app/MessageDef/DataVersionFilterIBs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include <stdarg.h>
#include <stdio.h>

#include <app/AppBuildConfig.h>
#include <app/AppConfig.h>

namespace chip {
namespace app {
Expand Down
2 changes: 1 addition & 1 deletion src/app/MessageDef/EventDataIB.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#include <stdarg.h>
#include <stdio.h>

#include <app/AppBuildConfig.h>
#include <app/AppConfig.h>

namespace chip {
namespace app {
Expand Down
2 changes: 1 addition & 1 deletion src/app/MessageDef/EventFilterIB.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#include <stdarg.h>
#include <stdio.h>

#include <app/AppBuildConfig.h>
#include <app/AppConfig.h>

namespace chip {
namespace app {
Expand Down
2 changes: 1 addition & 1 deletion src/app/MessageDef/EventFilterIBs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include <stdarg.h>
#include <stdio.h>

#include <app/AppBuildConfig.h>
#include <app/AppConfig.h>

namespace chip {
namespace app {
Expand Down
2 changes: 1 addition & 1 deletion src/app/MessageDef/EventPathIB.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include <stdarg.h>
#include <stdio.h>

#include <app/AppBuildConfig.h>
#include <app/AppConfig.h>

namespace chip {
namespace app {
Expand Down
2 changes: 1 addition & 1 deletion src/app/MessageDef/EventPathIBs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include <stdarg.h>
#include <stdio.h>

#include <app/AppBuildConfig.h>
#include <app/AppConfig.h>

namespace chip {
namespace app {
Expand Down
2 changes: 1 addition & 1 deletion src/app/MessageDef/EventReportIB.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include <stdarg.h>
#include <stdio.h>

#include <app/AppBuildConfig.h>
#include <app/AppConfig.h>

namespace chip {
namespace app {
Expand Down
2 changes: 1 addition & 1 deletion src/app/MessageDef/EventReportIBs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#include <stdarg.h>
#include <stdio.h>

#include <app/AppBuildConfig.h>
#include <app/AppConfig.h>

namespace chip {
namespace app {
Expand Down
2 changes: 1 addition & 1 deletion src/app/MessageDef/EventStatusIB.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#include <stdarg.h>
#include <stdio.h>

#include <app/AppBuildConfig.h>
#include <app/AppConfig.h>

namespace chip {
namespace app {
Expand Down
2 changes: 1 addition & 1 deletion src/app/MessageDef/InvokeRequestMessage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include "InvokeRequestMessage.h"
#include "MessageDefHelper.h"

#include <app/AppBuildConfig.h>
#include <app/AppConfig.h>

namespace chip {
namespace app {
Expand Down
2 changes: 1 addition & 1 deletion src/app/MessageDef/InvokeRequests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include <stdarg.h>
#include <stdio.h>

#include <app/AppBuildConfig.h>
#include <app/AppConfig.h>

namespace chip {
namespace app {
Expand Down
2 changes: 1 addition & 1 deletion src/app/MessageDef/InvokeResponseIB.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include "InvokeResponseIB.h"
#include "MessageDefHelper.h"

#include <app/AppBuildConfig.h>
#include <app/AppConfig.h>

namespace chip {
namespace app {
Expand Down
2 changes: 1 addition & 1 deletion src/app/MessageDef/InvokeResponseIBs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include <stdarg.h>
#include <stdio.h>

#include <app/AppBuildConfig.h>
#include <app/AppConfig.h>

namespace chip {
namespace app {
Expand Down
2 changes: 1 addition & 1 deletion src/app/MessageDef/InvokeResponseMessage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include "InvokeResponseMessage.h"
#include "MessageDefHelper.h"

#include <app/AppBuildConfig.h>
#include <app/AppConfig.h>

namespace chip {
namespace app {
Expand Down
2 changes: 1 addition & 1 deletion src/app/MessageDef/MessageDefHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

#include "MessageDefHelper.h"
#include <algorithm>
#include <app/AppBuildConfig.h>
#include <app/AppConfig.h>
#include <app/InteractionModelRevision.h>
#include <app/util/basic-types.h>
#include <inttypes.h>
Expand Down
2 changes: 1 addition & 1 deletion src/app/MessageDef/ReadRequestMessage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include <stdarg.h>
#include <stdio.h>

#include <app/AppBuildConfig.h>
#include <app/AppConfig.h>

namespace chip {
namespace app {
Expand Down
2 changes: 1 addition & 1 deletion src/app/MessageDef/ReportDataMessage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#include <stdarg.h>
#include <stdio.h>

#include <app/AppBuildConfig.h>
#include <app/AppConfig.h>

using namespace chip;

Expand Down
2 changes: 1 addition & 1 deletion src/app/MessageDef/StatusIB.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#include <stdarg.h>
#include <stdio.h>

#include <app/AppBuildConfig.h>
#include <app/AppConfig.h>
#include <lib/core/CHIPCore.h>

using namespace chip;
Expand Down
2 changes: 1 addition & 1 deletion src/app/MessageDef/WriteRequestMessage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#include <stdarg.h>
#include <stdio.h>

#include <app/AppBuildConfig.h>
#include <app/AppConfig.h>

namespace chip {
namespace app {
Expand Down
2 changes: 1 addition & 1 deletion src/app/MessageDef/WriteResponseMessage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include <stdarg.h>
#include <stdio.h>

#include <app/AppBuildConfig.h>
#include <app/AppConfig.h>

namespace chip {
namespace app {
Expand Down
2 changes: 1 addition & 1 deletion src/app/ReadClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
*
*/

#include <app/AppBuildConfig.h>
#include <app/AppConfig.h>
#include <app/InteractionModelEngine.h>
#include <app/InteractionModelHelper.h>
#include <app/ReadClient.h>
Expand Down
2 changes: 1 addition & 1 deletion src/app/ReadHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
*
*/

#include <app/AppBuildConfig.h>
#include <app/AppConfig.h>
#include <app/InteractionModelEngine.h>
#include <app/MessageDef/EventPathIB.h>
#include <app/MessageDef/StatusResponseMessage.h>
Expand Down
2 changes: 1 addition & 1 deletion src/app/WriteClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
*/

#include "lib/core/CHIPError.h"
#include <app/AppBuildConfig.h>
#include <app/AppConfig.h>
#include <app/InteractionModelEngine.h>
#include <app/TimedRequest.h>
#include <app/WriteClient.h>
Expand Down
2 changes: 1 addition & 1 deletion src/app/WriteHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*/

#include "messaging/ExchangeContext.h"
#include <app/AppBuildConfig.h>
#include <app/AppConfig.h>
#include <app/InteractionModelEngine.h>
#include <app/MessageDef/EventPathIB.h>
#include <app/StatusResponse.h>
Expand Down
2 changes: 1 addition & 1 deletion src/app/reporting/Engine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
*
*/

#include <app/AppBuildConfig.h>
#include <app/AppConfig.h>
#include <app/InteractionModelEngine.h>
#include <app/reporting/Engine.h>
#include <app/util/MatterCallbacks.h>
Expand Down
Loading

0 comments on commit 8484873

Please sign in to comment.