summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorThiago Marcos P. Santos <thiago@mapbox.com>2016-10-04 17:26:08 +0300
committerThiago Marcos P. Santos <tmpsantos@gmail.com>2016-10-05 11:12:16 +0300
commit5829c0dbc6e7785cec5af12891ba2ead784d1a69 (patch)
treec01a0f92e093316b44a23e0aac27ae38c5b538ce /cmake
parentdd604a7b3650617ab3fef81eef1a63fc28761396 (diff)
downloadqtlocation-mapboxgl-5829c0dbc6e7785cec5af12891ba2ead784d1a69.tar.gz
[build] Re-add benchmark tests to the buildsystem
Probably lost on the cmake migration
Diffstat (limited to 'cmake')
-rw-r--r--cmake/benchmark-files.cmake15
-rw-r--r--cmake/benchmark.cmake32
2 files changed, 47 insertions, 0 deletions
diff --git a/cmake/benchmark-files.cmake b/cmake/benchmark-files.cmake
new file mode 100644
index 0000000000..4e3045647d
--- /dev/null
+++ b/cmake/benchmark-files.cmake
@@ -0,0 +1,15 @@
+# Do not edit. Regenerate this with ./scripts/generate-benchmark-files.sh
+
+set(MBGL_BENCHMARK_FILES
+ # include/mbgl
+ benchmark/include/mbgl/benchmark.hpp
+
+ # parse
+ benchmark/parse/filter.benchmark.cpp
+
+ # src
+ benchmark/src/main.cpp
+
+ # src/mbgl/benchmark
+ benchmark/src/mbgl/benchmark/benchmark.cpp
+)
diff --git a/cmake/benchmark.cmake b/cmake/benchmark.cmake
new file mode 100644
index 0000000000..79da54459e
--- /dev/null
+++ b/cmake/benchmark.cmake
@@ -0,0 +1,32 @@
+add_executable(mbgl-benchmark
+ ${MBGL_BENCHMARK_FILES}
+)
+
+target_compile_options(mbgl-benchmark
+ PRIVATE -fvisibility-inlines-hidden
+)
+
+target_include_directories(mbgl-benchmark
+ PRIVATE include
+ PRIVATE src # TODO: eliminate
+ PRIVATE benchmark/include
+ PRIVATE benchmark/src
+ PRIVATE platform/default
+)
+
+if(DEFINED ENV{CI})
+ target_compile_definitions(mbgl-benchmark
+ PRIVATE -DCI_BUILD=1
+ )
+endif()
+
+target_link_libraries(mbgl-benchmark
+ PRIVATE mbgl-core
+)
+
+target_add_mason_package(mbgl-benchmark PRIVATE benchmark)
+target_add_mason_package(mbgl-benchmark PRIVATE rapidjson)
+
+mbgl_platform_benchmark()
+
+create_source_groups(mbgl-benchmark)