Skip to content

Commit

Permalink
Stop using app-specific codegen in Darwin framework builds. (#26669)
Browse files Browse the repository at this point in the history
  • Loading branch information
bzbarsky-apple authored and pull[bot] committed Aug 23, 2023
1 parent b58ab50 commit 3b64f2f
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 6 deletions.
6 changes: 6 additions & 0 deletions src/app/util/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@

#pragma once

#include <lib/core/CHIPConfig.h>

#if !CHIP_CONFIG_SKIP_APP_SPECIFIC_GENERATED_HEADER_INCLUDES

// include generated configuration information from AppBuilder.
// ZA_GENERATED_HEADER is defined in the project file
#ifdef ZA_GENERATED_HEADER
Expand All @@ -31,6 +35,8 @@
#include <zap-generated/endpoint_config.h>
#endif

#endif // !CHIP_CONFIG_SKIP_APP_SPECIFIC_GENERATED_HEADER_INCLUDES

// User options for plugin Binding Table Library
// TODO: Make this a CHIP_CONFIG value.
#ifndef EMBER_BINDING_TABLE_SIZE
Expand Down
4 changes: 4 additions & 0 deletions src/app/util/privilege-storage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,13 @@
* limitations under the License.
*/

#include <lib/core/CHIPConfig.h>

#include "privilege-storage.h"

#if !CHIP_CONFIG_SKIP_APP_SPECIFIC_GENERATED_HEADER_INCLUDES
#include <zap-generated/access.h>
#endif // !CHIP_CONFIG_SKIP_APP_SPECIFIC_GENERATED_HEADER_INCLUDES

#include <lib/support/CodeUtils.h>

Expand Down
8 changes: 2 additions & 6 deletions src/darwin/Framework/Matter.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1522,7 +1522,6 @@
"$(CHIP_ROOT)/third_party/editline/repo/include",
"$(CHIP_ROOT)/src/include",
"$(CONFIGURATION_TEMP_DIR)/Matter.build/out/gen/include",
"$(CHIP_ROOT)/zzz_generated/darwin/controller-clusters",
"$(CHIP_ROOT)/third_party/inipp/repo/inipp",
"$(CHIP_ROOT)/third_party/editline/include",
"$(CHIP_ROOT)/examples/chip-tool",
Expand Down Expand Up @@ -1571,7 +1570,6 @@
"$(CHIP_ROOT)/third_party/editline/repo/include",
"$(CHIP_ROOT)/src/include",
"$(CONFIGURATION_TEMP_DIR)/Matter.build/out/gen/include",
"$(CHIP_ROOT)/zzz_generated/darwin/controller-clusters",
"$(SRCROOT)/darwin-framework-tool",
"$(CHIP_ROOT)/third_party/inipp/repo/inipp",
"$(CHIP_ROOT)/third_party/editline/include",
Expand Down Expand Up @@ -1678,6 +1676,7 @@
"$(inherited)",
"MTR_NEWLY_AVAILABLE=",
"MTR_NEWLY_DEPRECATED(message)=",
"CHIP_CONFIG_SKIP_APP_SPECIFIC_GENERATED_HEADER_INCLUDES=1",
);
HEADER_SEARCH_PATHS = (
"$(CHIP_ROOT)/src",
Expand All @@ -1692,8 +1691,6 @@
"$(TEMP_DIR)/out/gen/include",
"$(CHIP_ROOT)/zzz_generated/",
"$(CHIP_ROOT)/zzz_generated/app-common",
"$(CHIP_ROOT)/zzz_generated/controller-clusters",
"$(CHIP_ROOT)/zzz_generated/darwin/controller-clusters",
);
INFOPLIST_FILE = CHIP/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
Expand Down Expand Up @@ -1831,6 +1828,7 @@
"$(inherited)",
"MTR_NEWLY_AVAILABLE=",
"MTR_NEWLY_DEPRECATED(message)=",
"CHIP_CONFIG_SKIP_APP_SPECIFIC_GENERATED_HEADER_INCLUDES=1",
);
HEADER_SEARCH_PATHS = (
"$(CHIP_ROOT)/src",
Expand All @@ -1845,8 +1843,6 @@
"$(TEMP_DIR)/out/gen/include",
"$(CHIP_ROOT)/zzz_generated/",
"$(CHIP_ROOT)/zzz_generated/app-common",
"$(CHIP_ROOT)/zzz_generated/controller-clusters",
"$(CHIP_ROOT)/zzz_generated/darwin/controller-clusters",
);
INFOPLIST_FILE = CHIP/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
Expand Down
14 changes: 14 additions & 0 deletions src/lib/core/CHIPConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -1423,6 +1423,20 @@ extern const char CHIP_NON_PRODUCTION_MARKER[];
#define CHIP_CONFIG_MAX_SCENES_CONCURRENT_ITERATORS 2
#endif

/**
* @def CHIP_CONFIG_SKIP_APP_SPECIFIC_GENERATED_HEADER_INCLUDES
*
* @brief Controls whether core data model code will try to include app-specific generated headers.
*
* If this is set to true, data model code will be compiled with no client or
* server clusters enabled and all required access control levels set to their
* defaults: (view for all attribute/event reads, operate for all writes and
* invokes).
*/
#ifndef CHIP_CONFIG_SKIP_APP_SPECIFIC_GENERATED_HEADER_INCLUDES
#define CHIP_CONFIG_SKIP_APP_SPECIFIC_GENERATED_HEADER_INCLUDES 0
#endif

/**
* @}
*/

0 comments on commit 3b64f2f

Please sign in to comment.