Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use generated headers consistently on darwin #11538

Merged
merged 1 commit into from
Nov 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions config/ios/SystemProjectConfig.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
*
* Copyright (c) 2021 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.
*/

/**
* @file
* chip::System project configuration for standalone builds on iOS
*
*/
#ifndef SYSTEMPROJECTCONFIG_H
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not #pragma once ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry copied from config/standalone/SystemProjectConfig.h which apparently wasn't migrated.

#define SYSTEMPROJECTCONFIG_H

#endif /* SYSTEMPROJECTCONFIG_H */
7 changes: 5 additions & 2 deletions src/darwin/CHIPTool/CHIPTool.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
HAVE_CONFIG_H,
CHIP_HAVE_CONFIG_H,
"DEBUG=1",
"$(inherited)",
);
Expand Down Expand Up @@ -536,7 +536,10 @@
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_NO_COMMON_BLOCKS = YES;
GCC_PREPROCESSOR_DEFINITIONS = HAVE_CONFIG_H;
GCC_PREPROCESSOR_DEFINITIONS = (
CHIP_HAVE_CONFIG_H,
"$(inherited)",
);
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
Expand Down
28 changes: 2 additions & 26 deletions src/darwin/Framework/CHIP.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -624,19 +624,7 @@
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
GCC_PREPROCESSOR_DEFINITIONS = (
"CHIP_PROJECT_CONFIG_INCLUDE=<CHIPProjectConfig.h>",
"CHIP_PLATFORM_CONFIG_INCLUDE=<platform/Darwin/CHIPPlatformConfig.h>",
"CHIP_DEVICE_PLATFORM_CONFIG_INCLUDE=<platform/Darwin/CHIPDevicePlatformConfig.h>",
CONFIG_NETWORK_LAYER_INET,
CONFIG_NETWORK_LAYER_BLE,
"CHIP_DEVICE_LAYER_TARGET=Darwin",
"CHIP_DEVICE_LAYER_TARGET_DARWIN=1",
"CHIP_DEVICE_LAYER_TARGET_LINUX=0",
"CHIP_DEVICE_LAYER_TARGET_NRF5=0",
"CHIP_DEVICE_LAYER_TARGET_EFR32=0",
"CHIP_SYSTEM_CONFIG_USE_SOCKETS=1",
"CHIP_SYSTEM_CONFIG_POSIX_LOCKING=0",
"CHIP_SYSTEM_CONFIG_NO_LOCKING=1",
CHIP_HAVE_CONFIG_H,
"$(inherited)",
);
HEADER_SEARCH_PATHS = (
Expand Down Expand Up @@ -769,19 +757,7 @@
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
GCC_PREPROCESSOR_DEFINITIONS = (
"CHIP_PROJECT_CONFIG_INCLUDE=<CHIPProjectConfig.h>",
"CHIP_PLATFORM_CONFIG_INCLUDE=<platform/Darwin/CHIPPlatformConfig.h>",
"CHIP_DEVICE_PLATFORM_CONFIG_INCLUDE=<platform/Darwin/CHIPDevicePlatformConfig.h>",
CONFIG_NETWORK_LAYER_INET,
CONFIG_NETWORK_LAYER_BLE,
"CHIP_DEVICE_LAYER_TARGET=Darwin",
"CHIP_DEVICE_LAYER_TARGET_DARWIN=1",
"CHIP_DEVICE_LAYER_TARGET_LINUX=0",
"CHIP_DEVICE_LAYER_TARGET_NRF5=0",
"CHIP_DEVICE_LAYER_TARGET_EFR32=0",
"CHIP_SYSTEM_CONFIG_USE_SOCKETS=1",
"CHIP_SYSTEM_CONFIG_POSIX_LOCKING=0",
"CHIP_SYSTEM_CONFIG_NO_LOCKING=1",
CHIP_HAVE_CONFIG_H,
"$(inherited)",
);
HEADER_SEARCH_PATHS = (
Expand Down
20 changes: 1 addition & 19 deletions src/darwin/Framework/chip_xcode_build_connector.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,19 +52,7 @@ for define in "${defines[@]}"; do

# skip over those that GN does for us
case "$define" in
CHIP_DEVICE_LAYER*)
continue
;;
CHIP_*_CONFIG_INCLUDE)
continue
;;
CHIP_SYSTEM_CONFIG_*)
continue
;;
CONFIG_NETWORK_LAYER*)
continue
;;
CHIP_CRYPTO_*)
CHIP_HAVE_CONFIG_H)
continue
;;
esac
Expand Down Expand Up @@ -108,10 +96,6 @@ declare -a args=(
'chip_crypto="mbedtls"'
'chip_build_tools=false'
'chip_build_tests=false'
'chip_ble_project_config_include=""'
'chip_device_project_config_include=""'
'chip_inet_project_config_include=""'
'chip_system_project_config_include=""'
'target_cpu="'"$target_cpu"'"'
'target_defines='"$target_defines"
'target_cflags=['"$target_cflags"']'
Expand All @@ -129,8 +113,6 @@ declare -a args=(
[[ $PLATFORM_FAMILY_NAME == macOS ]] && {
args+=(
'target_os="mac"'
'import("//config/standalone/args.gni")'
'chip_project_config_include_dirs=["'"$CHIP_ROOT"'/config/standalone"]'
)
}

Expand Down