Skip to content

Commit

Permalink
Skip generation for union test
Browse files Browse the repository at this point in the history
  • Loading branch information
mannprerak2 committed Nov 18, 2023
1 parent 0f7e74d commit ba86016
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 0 additions & 2 deletions pkgs/ffigen/lib/src/config_provider/config.dart
Original file line number Diff line number Diff line change
Expand Up @@ -259,8 +259,6 @@ class Config {
_logger.severe(
'Objective C support is EXPERIMENTAL. The API may change '
'in a breaking way without notice.');
// Ignore source errors for ObjC.
ignoreSourceErrors = true;
return Language.objc;
} else {
return Language.c;
Expand Down
7 changes: 5 additions & 2 deletions pkgs/ffigen/lib/src/header_parser/parser.dart
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,13 @@ List<Binding> parseToBindings(Config c) {
}

if (hasSourceErrors) {
_logger.severe(
_logger.warning(
"The compiler found some warnings/errors in source files. This might generate invalid bindings due to a wrong compiler guess.");
if (config.ignoreSourceErrors) {
_logger.severe("Ignored source errors.");
_logger.warning(
"Ignored source errors. (User supplied --ignore-source-errors)");
} else if (config.language == Language.objc) {
_logger.warning("Ignored source errors. (ObjC)");
} else {
_logger.severe(
"Skipped generating bindings due to errors in source files. Either resolve or ignore them (Set --ignore-source-errors on cmd or ignore-source-errors:true in config.");
Expand Down
1 change: 1 addition & 0 deletions pkgs/ffigen/test/header_parser_tests/unions_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ ${strings.output}: 'unused'
${strings.headers}:
${strings.entryPoints}:
- 'test/header_parser_tests/unions.h'
${strings.ignoreSourceErrors}: true
'''),
);
});
Expand Down

0 comments on commit ba86016

Please sign in to comment.