summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
authorJuha Alanen <juha.alanen@mapbox.com>2020-02-12 14:05:22 +0200
committerJuha Alanen <juha.alanen@mapbox.com>2020-02-18 16:10:23 +0200
commitcea87c9f2d0eb66e3a918d1b84e316b27462dd07 (patch)
tree389fff07f377377e34887f6a46f370ff55a445c1 /platform
parenta5ec862a2a241885918d4d843bbc93c3804a57e6 (diff)
downloadqtlocation-mapboxgl-cea87c9f2d0eb66e3a918d1b84e316b27462dd07.tar.gz
[benchmark] Add iOS benchmark runner
Diffstat (limited to 'platform')
-rw-r--r--platform/ios/ios.cmake72
1 files changed, 72 insertions, 0 deletions
diff --git a/platform/ios/ios.cmake b/platform/ios/ios.cmake
index f9f6f540ce..eb1d339c9d 100644
--- a/platform/ios/ios.cmake
+++ b/platform/ios/ios.cmake
@@ -265,4 +265,76 @@ if(MBGL_IOS_UNIT_TEST)
set_target_properties(UnitTestsAppTests PROPERTIES XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED "NO")
endif()
+if(MBGL_IOS_BENCHMARK)
+ execute_process(COMMAND ditto ${PROJECT_SOURCE_DIR}/benchmark/fixtures ${CMAKE_CURRENT_BINARY_DIR}/benchmark-data/benchmark/fixtures)
+ execute_process(
+ COMMAND
+ ditto ${PROJECT_SOURCE_DIR}/test/fixtures/api/assets/streets
+ ${CMAKE_CURRENT_BINARY_DIR}/benchmark-data/test/fixtures/api/assets/streets
+ )
+
+ set(RESOURCES ${PROJECT_SOURCE_DIR}/platform/ios/test/common/Main.storyboard
+ ${PROJECT_SOURCE_DIR}/platform/ios/test/common/LaunchScreen.storyboard ${CMAKE_CURRENT_BINARY_DIR}/benchmark-data)
+
+ add_executable(
+ BenchmarkApp
+ ${PROJECT_SOURCE_DIR}/platform/ios/test/common/ios_test_runner.hpp
+ ${PROJECT_SOURCE_DIR}/platform/ios/test/common/AppDelegate.h
+ ${PROJECT_SOURCE_DIR}/platform/ios/test/common/AppDelegate.m
+ ${PROJECT_SOURCE_DIR}/platform/ios/test/common/iosTestRunner.mm
+ ${PROJECT_SOURCE_DIR}/platform/ios/test/common/main.m
+ ${PROJECT_SOURCE_DIR}/benchmark/ios/ios_test_runner.cpp
+ ${PROJECT_SOURCE_DIR}/benchmark/ios/iosTestRunner.h
+ ${RESOURCES}
+ )
+ initialize_ios_target(BenchmarkApp)
+
+ target_include_directories(
+ BenchmarkApp
+ PUBLIC
+ ${PROJECT_SOURCE_DIR}/include
+ ${PROJECT_SOURCE_DIR}/platform/ios/test/common
+ ${PROJECT_SOURCE_DIR}/benchmark/include
+ ${PROJECT_SOURCE_DIR}/benchmark/ios
+ )
+
+ target_link_libraries(
+ BenchmarkApp
+ PRIVATE
+ "-framework CoreGraphics"
+ "-framework CoreLocation"
+ "-framework Foundation"
+ "-framework OpenGLES"
+ "-framework QuartzCore"
+ "-framework UIKit"
+ mbgl-compiler-options
+ -Wl,-force_load
+ mbgl-benchmark
+ )
+
+ set_target_properties(BenchmarkApp PROPERTIES MACOSX_BUNDLE TRUE)
+ set_target_properties(BenchmarkApp PROPERTIES MACOSX_BUNDLE_IDENTIFIER com.mapbox.BenchmarkApp)
+ set_target_properties(BenchmarkApp PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${PROJECT_SOURCE_DIR}/benchmark/ios/Info.plist)
+ set_target_properties(BenchmarkApp PROPERTIES RESOURCE "${RESOURCES}")
+ set_target_properties(BenchmarkApp PROPERTIES XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "")
+ set_target_properties(BenchmarkApp PROPERTIES XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED "NO")
+
+ find_package(XCTest REQUIRED)
+
+ xctest_add_bundle(BenchmarkAppTests BenchmarkApp ${PROJECT_SOURCE_DIR}/platform/ios/test/common/Tests.m)
+
+ target_include_directories(
+ BenchmarkAppTests
+ PUBLIC ${PROJECT_SOURCE_DIR}/benchmark/ios
+ )
+
+ xctest_add_test(XCTest.BenchmarkApp BenchmarkAppTests)
+
+ set_target_properties(BenchmarkAppTests PROPERTIES XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET "${IOS_DEPLOYMENT_TARGET}")
+ set_target_properties(BenchmarkAppTests PROPERTIES XCODE_ATTRIBUTE_ONLY_ACTIVE_ARCH $<$<CONFIG:Debug>:YES>)
+ set_target_properties(BenchmarkAppTests PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${PROJECT_SOURCE_DIR}/benchmark/ios/tests/Info.plist)
+ set_target_properties(BenchmarkAppTests PROPERTIES XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "")
+ set_target_properties(BenchmarkAppTests PROPERTIES XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED "NO")
+endif()
+
unset(IOS_DEPLOYMENT_TARGET CACHE)