diff --git a/ios/TestApp/TestApp/Benchmark.h b/ios/TestApp/TestApp/Benchmark.h index cd45665aba46ec..c05cc60b01d398 100644 --- a/ios/TestApp/TestApp/Benchmark.h +++ b/ios/TestApp/TestApp/Benchmark.h @@ -1,3 +1,5 @@ +#ifdef BUILD_LITE_INTERPRETER + #import NS_ASSUME_NONNULL_BEGIN @@ -10,3 +12,4 @@ NS_ASSUME_NONNULL_BEGIN @end NS_ASSUME_NONNULL_END +#endif diff --git a/ios/TestApp/TestApp/Benchmark.mm b/ios/TestApp/TestApp/Benchmark.mm index 2070eff723ecfb..6b94e1b18062d2 100644 --- a/ios/TestApp/TestApp/Benchmark.mm +++ b/ios/TestApp/TestApp/Benchmark.mm @@ -1,3 +1,5 @@ +#ifdef BUILD_LITE_INTERPRETER + #import "Benchmark.h" #include #include @@ -103,3 +105,4 @@ + (NSString*)run { } @end +#endif diff --git a/ios/TestApp/TestApp/ViewController.mm b/ios/TestApp/TestApp/ViewController.mm index 89ba1202392b85..413d4e9d88f827 100644 --- a/ios/TestApp/TestApp/ViewController.mm +++ b/ios/TestApp/TestApp/ViewController.mm @@ -1,6 +1,9 @@ #import "ViewController.h" + +#ifdef BUILD_LITE_INTERPRETER #import "Benchmark.h" +#endif @interface ViewController () @property(nonatomic, strong) UITextView* textView; @@ -11,6 +14,7 @@ @implementation ViewController - (void)viewDidLoad { [super viewDidLoad]; +#ifdef BUILD_LITE_INTERPRETER self.textView = [[UITextView alloc] initWithFrame:self.view.bounds]; self.textView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; [self.view addSubview:self.textView]; @@ -30,8 +34,10 @@ - (void)viewDidLoad { [Benchmark setup:config]; [self runBenchmark]; +#endif } +#ifdef BUILD_LITE_INTERPRETER - (void)runBenchmark { self.textView.text = @"Start benchmarking...\n"; dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ @@ -41,5 +47,6 @@ - (void)runBenchmark { }); }); } +#endif @end diff --git a/ios/TestApp/benchmark/setup.rb b/ios/TestApp/benchmark/setup.rb index b7e64bdc319b7a..3b491abec3c32c 100644 --- a/ios/TestApp/benchmark/setup.rb +++ b/ios/TestApp/benchmark/setup.rb @@ -36,6 +36,11 @@ config.build_settings['LIBRARY_SEARCH_PATHS'] = libraries_search_path config.build_settings['OTHER_LDFLAGS'] = other_linker_flags config.build_settings['ENABLE_BITCODE'] = 'No' + if (options[:lite]) + config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] = ['$(inherited)', "BUILD_LITE_INTERPRETER"] + else + config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] = ['$(inherited)'] + end dev_team_id = options[:team_id] if dev_team_id config.build_settings['DEVELOPMENT_TEAM'] = dev_team_id