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

Darwin: Move warning settings into the Xcode project #32828

Merged
merged 8 commits into from
Apr 3, 2024
10 changes: 1 addition & 9 deletions .github/workflows/darwin-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,7 @@ jobs:

- name: Run macOS Darwin Framework Tool Build Debug
working-directory: src/darwin/Framework
# Keep whatever Xcode settings
# for OTHER_CFLAGS exist by using ${inherited}.
#
# Enable -Wconversion by hand as well, because it seems to not be
# enabled by default in the Xcode config.
#
# Disable availability annotations, since we are not building against a system
# Matter.framework.
run: xcodebuild -target "darwin-framework-tool" -sdk macosx -configuration Debug OTHER_CFLAGS='${inherited} -Wconversion' GCC_PREPROCESSOR_DEFINITIONS='${inherited} MTR_NO_AVAILABILITY=1'
run: xcodebuild -target "darwin-framework-tool" -sdk macosx -configuration Debug
- name: Delete Defaults
run: defaults delete com.apple.dt.xctest.tool
continue-on-error: true
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/darwin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@ jobs:
matrix:
options: # We don't need a full matrix
- flavor: macos-release-availability
arguments: -sdk macosx -configuration Release WARNING_CFLAGS='${inherited} -Werror -Wconversion -Wno-unguarded-availability-new'
arguments: -sdk macosx -configuration Release WARNING_CFLAGS='${inherited} -Wno-unguarded-availability-new' OTHER_CFLAGS='${inherited} -UMTR_NO_AVAILABILITY'
- flavor: ios-release
arguments: -sdk iphoneos -configuration Release WARNING_CFLAGS='${inherited} -Werror -Wconversion' GCC_PREPROCESSOR_DEFINITIONS='${inherited} MTR_NO_AVAILABILITY=1'
arguments: -sdk iphoneos -configuration Release
- flavor: ios-debug
arguments: -sdk iphoneos -configuration Debug WARNING_CFLAGS='${inherited} -Werror -Wconversion' GCC_PREPROCESSOR_DEFINITIONS='${inherited} MTR_NO_AVAILABILITY=1'
arguments: -sdk iphoneos -configuration Debug
- flavor: tvos-debug
arguments: -sdk appletvos -configuration Debug WARNING_CFLAGS='${inherited} -Werror -Wconversion' GCC_PREPROCESSOR_DEFINITIONS='${inherited} MTR_NO_AVAILABILITY=1'
arguments: -sdk appletvos -configuration Debug
- flavor: watchos-debug
arguments: -sdk watchos -configuration Debug WARNING_CFLAGS='${inherited} -Werror -Wconversion' GCC_PREPROCESSOR_DEFINITIONS='${inherited} MTR_NO_AVAILABILITY=1'
arguments: -sdk watchos -configuration Debug
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down
25 changes: 25 additions & 0 deletions src/darwin/Framework/CHIPTests/MTRAvailabilityTest.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/**
* Copyright (c) 2024 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 <Matter/Matter.h>

// The purpose of this test is to ensure that our availablity annotations are
// at least syntactically valid, because within the project we generally
// compile everything with MTR_NO_AVAILABILITY=1 (so that we can internally use
// and test features of Matter.framework independently of when they will ship.)
#if MTR_NO_AVAILABILITY
#error This test must be compiled with MTR_NO_AVAILABILITY=0
#endif
Loading
Loading