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

[ffigen] Add compiler option -Wno-nullability-completeness by default #1074

Merged
merged 4 commits into from
Apr 10, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
1 change: 1 addition & 0 deletions pkgs/ffigen/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
`ffi-native` option.
- Add `retainAndReturnPointer` method to ObjC objects and blocks, and add
`castFromPointer` method to blocks.
- Add `-Wno-nullability-completeness` as default compiler option for MacOS.

## 11.0.0

Expand Down
1 change: 0 additions & 1 deletion pkgs/ffigen/example/libclang-example/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ headers:
compiler-opts:
- '-I../../third_party/libclang/include'
- '-I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/'
- '-Wno-nullability-completeness'
functions:
include:
- 'clang_.*' # Can be a regexp, '.' matches any character.
Expand Down
10 changes: 5 additions & 5 deletions pkgs/ffigen/lib/src/config_provider/config_types.dart
Original file line number Diff line number Diff line change
Expand Up @@ -347,11 +347,11 @@ class CompilerOptsAuto {

/// Extracts compiler options based on OS and config.
List<String> extractCompilerOpts() {
if (Platform.isMacOS && macIncludeStdLib) {
return getCStandardLibraryHeadersForMac();
}

return [];
return [
if (Platform.isMacOS && macIncludeStdLib)
...getCStandardLibraryHeadersForMac(),
if (Platform.isMacOS) '-Wno-nullability-completeness',
Copy link
Contributor

Choose a reason for hiding this comment

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

Why only mac? All the configs use this flag on all platforms.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I believe this flag does nothing on other OSes, it's an Xcode only flag.

];
}
}

Expand Down
1 change: 0 additions & 1 deletion pkgs/ffigen/test/native_test/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ headers:
include-directives:
- '**native_test.c'

compiler-opts: '-Wno-nullability-completeness'
preamble: |
// ignore_for_file: camel_case_types, non_constant_identifier_names

1 change: 0 additions & 1 deletion pkgs/ffigen/tool/libclang_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ description: Holds bindings to LibClang.
output: '../lib/src/header_parser/clang_bindings/clang_bindings.dart'
compiler-opts:
- '-Ithird_party/libclang/include'
- '-Wno-nullability-completeness'
headers:
entry-points:
- '../third_party/libclang/include/clang-c/Index.h'
Expand Down
Loading