From 744cb22c1b445e347aacf3f6d5cf2f17d59a78a2 Mon Sep 17 00:00:00 2001 From: Rob Walker Date: Wed, 20 May 2020 08:09:26 -0700 Subject: [PATCH] groom chip_xcode_connector.sh (#775) * groom chip_xcode_connector.sh * resurrect the app --- .../CHIP/chip_xcode_build_connector.sh | 17 ++-- .../project.pbxproj | 42 +++++----- .../xcschemes/CHIPQRCodeReader.xcscheme | 78 +++++++++++++++++++ 3 files changed, 110 insertions(+), 27 deletions(-) create mode 100644 src/CHIP_Framework_iOS/CHIPQRCodeReader/CHIPQRCodeReader.xcodeproj/xcshareddata/xcschemes/CHIPQRCodeReader.xcscheme diff --git a/src/CHIP_Framework_iOS/CHIP/chip_xcode_build_connector.sh b/src/CHIP_Framework_iOS/CHIP/chip_xcode_build_connector.sh index f5fa841e37d5f2..f8c0f9c24fd490 100755 --- a/src/CHIP_Framework_iOS/CHIP/chip_xcode_build_connector.sh +++ b/src/CHIP_Framework_iOS/CHIP/chip_xcode_build_connector.sh @@ -25,17 +25,22 @@ CHIP_PREFIX=${CHIP_PREFIX:-"$BUILT_PRODUCTS_DIR"} [[ -d ${CHIP_ROOT} ]] || die Please set CHIP_ROOT to the location of the CHIP directory +DEFINES=() # lots of environment variables passed by xcode to this script -if [[ ${CONFIGURATION} == Debug ]]; then +if [[ ${CONFIGURATION} == Debug* ]]; then configure_OPTIONS+=(--enable-debug) - DEFINES+="-DDEBUG=1 -UNDEBUG" + DEFINES+=(-UNDEBUG) else - DEFINES+="-DNDEBUG=1 -UDEBUG" + DEFINES+=(-UDEBUG) fi +read -r -a GCC_PREPROCESSOR_DEFINITIONS <<<"$GCC_PREPROCESSOR_DEFINITIONS" + +DEFINES+=("${GCC_PREPROCESSOR_DEFINITIONS[@]/#/-D}") + ARCH_FLAGS="-arch $ARCHS" SYSROOT_FLAGS="-isysroot $SDK_DIR" -COMPILER_FLAGS="$ARCH_FLAGS $SYSROOT_FLAGS $DEFINES" +COMPILER_FLAGS="$ARCH_FLAGS $SYSROOT_FLAGS ${DEFINES[*]}" configure_OPTIONS+=( CPP="cc -E" @@ -47,11 +52,11 @@ configure_OPTIONS+=( LDFLAGS="$ARCH_FLAGS" ) -[[ ${PLATFORM_NAME} == iphoneos ]] && { +[[ ${PLATFORM_FAMILY_NAME} == iOS ]] && { configure_OPTIONS+=(--with-chip-project-includes="$CHIP_ROOT"/config/ios --with-logging-style=external) } -[[ ${PLATFORM_NAME} == macosx ]] && configure_OPTIONS+=(--with-chip-project-includes=no) +[[ ${PLATFORM_FAMILY_NAME} == macOS ]] && configure_OPTIONS+=(--with-chip-project-includes=no) configure_OPTIONS+=( --prefix="$CHIP_PREFIX" diff --git a/src/CHIP_Framework_iOS/CHIPQRCodeReader/CHIPQRCodeReader.xcodeproj/project.pbxproj b/src/CHIP_Framework_iOS/CHIPQRCodeReader/CHIPQRCodeReader.xcodeproj/project.pbxproj index c406171b7fcd2b..6057cb880b58ba 100644 --- a/src/CHIP_Framework_iOS/CHIPQRCodeReader/CHIPQRCodeReader.xcodeproj/project.pbxproj +++ b/src/CHIP_Framework_iOS/CHIPQRCodeReader/CHIPQRCodeReader.xcodeproj/project.pbxproj @@ -277,7 +277,7 @@ /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ - B204A649244E1D0700C7C0E1 /* Debug */ = { + B204A649244E1D0700C7C0E1 /* Debug iOS */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; @@ -333,9 +333,9 @@ ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; }; - name = Debug; + name = "Debug iOS"; }; - B204A64A244E1D0700C7C0E1 /* Release */ = { + B204A64A244E1D0700C7C0E1 /* Release iOS */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; @@ -385,9 +385,9 @@ SDKROOT = iphoneos; VALIDATE_PRODUCT = YES; }; - name = Release; + name = "Release iOS"; }; - B204A64C244E1D0700C7C0E1 /* Debug */ = { + B204A64C244E1D0700C7C0E1 /* Debug iOS */ = { isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; @@ -405,9 +405,9 @@ PROVISIONING_PROFILE_SPECIFIER = ""; TARGETED_DEVICE_FAMILY = "1,2"; }; - name = Debug; + name = "Debug iOS"; }; - B204A64D244E1D0700C7C0E1 /* Release */ = { + B204A64D244E1D0700C7C0E1 /* Release iOS */ = { isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; @@ -425,9 +425,9 @@ PROVISIONING_PROFILE_SPECIFIER = ""; TARGETED_DEVICE_FAMILY = "1,2"; }; - name = Release; + name = "Release iOS"; }; - B204A64F244E1D0700C7C0E1 /* Debug */ = { + B204A64F244E1D0700C7C0E1 /* Debug iOS */ = { isa = XCBuildConfiguration; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; @@ -444,9 +444,9 @@ TARGETED_DEVICE_FAMILY = "1,2"; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/CHIPQRCodeReader.app/CHIPQRCodeReader"; }; - name = Debug; + name = "Debug iOS"; }; - B204A650244E1D0700C7C0E1 /* Release */ = { + B204A650244E1D0700C7C0E1 /* Release iOS */ = { isa = XCBuildConfiguration; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; @@ -463,7 +463,7 @@ TARGETED_DEVICE_FAMILY = "1,2"; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/CHIPQRCodeReader.app/CHIPQRCodeReader"; }; - name = Release; + name = "Release iOS"; }; /* End XCBuildConfiguration section */ @@ -471,29 +471,29 @@ B204A617244E1D0600C7C0E1 /* Build configuration list for PBXProject "CHIPQRCodeReader" */ = { isa = XCConfigurationList; buildConfigurations = ( - B204A649244E1D0700C7C0E1 /* Debug */, - B204A64A244E1D0700C7C0E1 /* Release */, + B204A649244E1D0700C7C0E1 /* Debug iOS */, + B204A64A244E1D0700C7C0E1 /* Release iOS */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; + defaultConfigurationName = "Release iOS"; }; B204A64B244E1D0700C7C0E1 /* Build configuration list for PBXNativeTarget "CHIPQRCodeReader" */ = { isa = XCConfigurationList; buildConfigurations = ( - B204A64C244E1D0700C7C0E1 /* Debug */, - B204A64D244E1D0700C7C0E1 /* Release */, + B204A64C244E1D0700C7C0E1 /* Debug iOS */, + B204A64D244E1D0700C7C0E1 /* Release iOS */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; + defaultConfigurationName = "Release iOS"; }; B204A64E244E1D0700C7C0E1 /* Build configuration list for PBXNativeTarget "CHIPQRCodeReaderTests" */ = { isa = XCConfigurationList; buildConfigurations = ( - B204A64F244E1D0700C7C0E1 /* Debug */, - B204A650244E1D0700C7C0E1 /* Release */, + B204A64F244E1D0700C7C0E1 /* Debug iOS */, + B204A650244E1D0700C7C0E1 /* Release iOS */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; + defaultConfigurationName = "Release iOS"; }; /* End XCConfigurationList section */ }; diff --git a/src/CHIP_Framework_iOS/CHIPQRCodeReader/CHIPQRCodeReader.xcodeproj/xcshareddata/xcschemes/CHIPQRCodeReader.xcscheme b/src/CHIP_Framework_iOS/CHIPQRCodeReader/CHIPQRCodeReader.xcodeproj/xcshareddata/xcschemes/CHIPQRCodeReader.xcscheme new file mode 100644 index 00000000000000..3832256d1b70f0 --- /dev/null +++ b/src/CHIP_Framework_iOS/CHIPQRCodeReader/CHIPQRCodeReader.xcodeproj/xcshareddata/xcschemes/CHIPQRCodeReader.xcscheme @@ -0,0 +1,78 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +