|
2 | 2 | // for details. All rights reserved. Use of this source code is governed by a |
3 | 3 | // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
|
| 5 | +import 'package:code_assets/code_assets.dart'; |
5 | 6 | import 'package:hooks/hooks.dart'; |
6 | 7 | import 'package:logging/logging.dart'; |
7 | 8 | import 'package:native_toolchain_c/native_toolchain_c.dart'; |
8 | 9 |
|
9 | 10 | void main(List<String> args) async { |
10 | | - await build( |
11 | | - args, |
12 | | - (input, output) async => |
13 | | - CBuilder.library( |
14 | | - name: 'cupertino_http', |
15 | | - assetName: 'src/native_cupertino_bindings.dart', |
16 | | - sources: ['src/native_cupertino_bindings.m'], |
17 | | - language: Language.objectiveC, |
18 | | - flags: ['-fobjc-arc'], |
19 | | - ).run( |
20 | | - input: input, |
21 | | - output: output, |
22 | | - logger: Logger('') |
23 | | - ..level = Level.ALL |
24 | | - ..onRecord.listen((record) { |
25 | | - print('${record.level.name}: ${record.time}: ${record.message}'); |
26 | | - }), |
27 | | - ), |
28 | | - ); |
| 11 | + await build(args, (input, output) async { |
| 12 | + if (input.config.code.targetOS != OS.iOS && |
| 13 | + input.config.code.targetOS != OS.macOS) { |
| 14 | + return; |
| 15 | + } |
| 16 | + await CBuilder.library( |
| 17 | + name: 'cupertino_http', |
| 18 | + assetName: 'src/native_cupertino_bindings.dart', |
| 19 | + sources: ['src/native_cupertino_bindings.m'], |
| 20 | + language: Language.objectiveC, |
| 21 | + flags: ['-fobjc-arc'], |
| 22 | + ).run( |
| 23 | + input: input, |
| 24 | + output: output, |
| 25 | + logger: Logger('') |
| 26 | + ..level = Level.ALL |
| 27 | + ..onRecord.listen((record) { |
| 28 | + print('${record.level.name}: ${record.time}: ${record.message}'); |
| 29 | + }), |
| 30 | + ); |
| 31 | + }); |
29 | 32 | } |
0 commit comments