[build] Add support for 'benchmark' target on macOS
This commit is contained in:
committed by
Thiago Marcos P. Santos
parent
dd7713f6ee
commit
214ec4e96a
12
Makefile
12
Makefile
@@ -88,6 +88,7 @@ $(MACOS_PROJ_PATH): $(BUILD_DEPS) $(MACOS_USER_DATA_PATH)/WorkspaceSettings.xcse
|
||||
@# Create Xcode schemes so that we can use xcodebuild from the command line. CMake doesn't
|
||||
@# create these automatically.
|
||||
SCHEME_NAME=mbgl-test SCHEME_TYPE=executable platform/macos/scripts/create_scheme.sh
|
||||
SCHEME_NAME=mbgl-benchmark SCHEME_TYPE=executable platform/macos/scripts/create_scheme.sh
|
||||
SCHEME_NAME=mbgl-render SCHEME_TYPE=executable platform/macos/scripts/create_scheme.sh
|
||||
SCHEME_NAME=mbgl-offline SCHEME_TYPE=executable platform/macos/scripts/create_scheme.sh
|
||||
SCHEME_NAME=mbgl-glfw SCHEME_TYPE=executable platform/macos/scripts/create_scheme.sh
|
||||
@@ -116,6 +117,10 @@ xproj: $(MACOS_PROJ_PATH)
|
||||
test: $(MACOS_PROJ_PATH)
|
||||
set -o pipefail && $(MACOS_XCODEBUILD) -scheme 'mbgl-test' build $(XCPRETTY)
|
||||
|
||||
.PHONY: benchmark
|
||||
benchmark: $(MACOS_PROJ_PATH)
|
||||
set -o pipefail && $(MACOS_XCODEBUILD) -scheme 'mbgl-benchmark' build $(XCPRETTY)
|
||||
|
||||
.PHONY: run-test
|
||||
run-test: run-test-*
|
||||
|
||||
@@ -124,6 +129,12 @@ run-test-%: test
|
||||
|| (lldb -c /cores/core.$$pid --batch --one-line 'thread backtrace all' --one-line 'quit' && exit 1))
|
||||
set -o pipefail && $(MACOS_XCODEBUILD) -scheme 'CI' test $(XCPRETTY)
|
||||
|
||||
.PHONY: run-benchmark
|
||||
run-benchmark: run-benchmark-.
|
||||
|
||||
run-benchmark-%: benchmark
|
||||
$(MACOS_OUTPUT_PATH)/$(BUILDTYPE)/mbgl-benchmark --benchmark_filter=$*
|
||||
|
||||
.PHONY: glfw-app
|
||||
glfw-app: $(MACOS_PROJ_PATH)
|
||||
set -o pipefail && $(MACOS_XCODEBUILD) -scheme 'mbgl-glfw' build $(XCPRETTY)
|
||||
@@ -392,6 +403,7 @@ $(MACOS_QT_PROJ_PATH): $(BUILD_DEPS)
|
||||
XCODEPROJ=$(MACOS_QT_PROJ_PATH) SCHEME_NAME=mbgl-qt SCHEME_TYPE=executable platform/macos/scripts/create_scheme.sh
|
||||
XCODEPROJ=$(MACOS_QT_PROJ_PATH) SCHEME_NAME=mbgl-qt-qml SCHEME_TYPE=executable platform/macos/scripts/create_scheme.sh
|
||||
XCODEPROJ=$(MACOS_QT_PROJ_PATH) SCHEME_NAME=mbgl-test SCHEME_TYPE=executable platform/macos/scripts/create_scheme.sh
|
||||
XCODEPROJ=$(MACOS_QT_PROJ_PATH) SCHEME_NAME=mbgl-benchmark SCHEME_TYPE=executable platform/macos/scripts/create_scheme.sh
|
||||
XCODEPROJ=$(MACOS_QT_PROJ_PATH) SCHEME_NAME=mbgl-core SCHEME_TYPE=library BUILDABLE_NAME=libmbgl-core.a BLUEPRINT_NAME=mbgl-core platform/macos/scripts/create_scheme.sh
|
||||
XCODEPROJ=$(MACOS_QT_PROJ_PATH) SCHEME_NAME=qmapboxgl SCHEME_TYPE=library BUILDABLE_NAME=libqmapboxgl.dylib BLUEPRINT_NAME=qmapboxgl platform/macos/scripts/create_scheme.sh
|
||||
|
||||
|
||||
Binary file not shown.
@@ -42,6 +42,16 @@ workflows:
|
||||
export BUILDTYPE=Debug
|
||||
make xproj
|
||||
- is_debug: 'yes'
|
||||
- script:
|
||||
title: Build Benchmark Tests
|
||||
run_if: '{{enveq "SKIPCI" "false"}}'
|
||||
inputs:
|
||||
- content: |-
|
||||
#!/bin/bash
|
||||
set -eu -o pipefail
|
||||
export BUILDTYPE=Debug
|
||||
make benchmark
|
||||
- is_debug: 'yes'
|
||||
- script:
|
||||
title: Run Core Tests
|
||||
run_if: '{{enveq "SKIPCI" "false"}}'
|
||||
|
||||
@@ -3,6 +3,7 @@ set(CMAKE_OSX_DEPLOYMENT_TARGET 10.10)
|
||||
mason_use(glfw VERSION 3.2.1)
|
||||
mason_use(boost_libprogram_options VERSION 1.60.0)
|
||||
mason_use(gtest VERSION 1.7.0${MASON_CXXABI_SUFFIX})
|
||||
mason_use(benchmark VERSION 1.0.0)
|
||||
|
||||
include(cmake/loop-darwin.cmake)
|
||||
|
||||
@@ -112,6 +113,27 @@ macro(mbgl_platform_test)
|
||||
)
|
||||
endmacro()
|
||||
|
||||
macro(mbgl_platform_benchmark)
|
||||
target_sources(mbgl-benchmark
|
||||
PRIVATE benchmark/src/main.cpp
|
||||
)
|
||||
|
||||
set_source_files_properties(
|
||||
benchmark/src/main.cpp
|
||||
PROPERTIES
|
||||
COMPILE_FLAGS -DWORK_DIRECTORY="${CMAKE_SOURCE_DIR}"
|
||||
)
|
||||
|
||||
target_link_libraries(mbgl-benchmark
|
||||
PRIVATE mbgl-loop
|
||||
PRIVATE "-framework Foundation"
|
||||
PRIVATE "-framework CoreGraphics"
|
||||
PRIVATE "-framework OpenGL"
|
||||
PRIVATE "-framework ImageIO"
|
||||
PRIVATE "-framework CoreServices"
|
||||
PRIVATE "-lsqlite3"
|
||||
)
|
||||
endmacro()
|
||||
|
||||
macro(mbgl_platform_node)
|
||||
target_link_libraries(mbgl-node
|
||||
|
||||
Reference in New Issue
Block a user