summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuha Alanen <juha.alanen@mapbox.com>2020-02-24 15:00:27 +0200
committerJuha Alanen <juha.alanen@mapbox.com>2020-02-27 10:09:35 +0200
commit18e9ed1c0b7007a0d4e2ce14ed687270900e24ba (patch)
treed23981fccfc5ccfdc04730cd2cb2236edb2aab0d
parent1374f94795141e7c67f486ee7dbb3ee85d028513 (diff)
downloadqtlocation-mapboxgl-18e9ed1c0b7007a0d4e2ce14ed687270900e24ba.tar.gz
[build] Build files related to OpenGL renderer only when the flag is enabled
-rw-r--r--platform/ios/ios.cmake27
-rw-r--r--test/CMakeLists.txt18
2 files changed, 28 insertions, 17 deletions
diff --git a/platform/ios/ios.cmake b/platform/ios/ios.cmake
index eb1d339c9d..3b86353558 100644
--- a/platform/ios/ios.cmake
+++ b/platform/ios/ios.cmake
@@ -1,8 +1,3 @@
-target_compile_definitions(
- mbgl-core
- PUBLIC MBGL_USE_GLES2 GLES_SILENCE_DEPRECATION
-)
-
if(NOT DEFINED IOS_DEPLOYMENT_TARGET)
set(IOS_DEPLOYMENT_TARGET "12.0")
endif()
@@ -16,13 +11,28 @@ endmacro()
set_target_properties(mbgl-core PROPERTIES XCODE_ATTRIBUTE_CLANG_ENABLE_OBJC_ARC YES)
+if(MBGL_WITH_OPENGL)
+ target_compile_definitions(
+ mbgl-core
+ PUBLIC MBGL_USE_GLES2 GLES_SILENCE_DEPRECATION
+ )
+ target_sources(
+ mbgl-core
+ PRIVATE
+ ${PROJECT_SOURCE_DIR}/platform/default/src/mbgl/gl/headless_backend.cpp
+ ${PROJECT_SOURCE_DIR}/platform/darwin/src/gl_functions.cpp ${PROJECT_SOURCE_DIR}/platform/darwin/src/headless_backend_eagl.mm
+ )
+ target_link_libraries(
+ mbgl-core
+ PRIVATE "-framework GLKit" "-framework OpenGLES"
+ )
+endif()
+
target_sources(
mbgl-core
PRIVATE
${PROJECT_SOURCE_DIR}/platform/darwin/src/async_task.cpp
${PROJECT_SOURCE_DIR}/platform/darwin/src/collator.mm
- ${PROJECT_SOURCE_DIR}/platform/darwin/src/gl_functions.cpp
- ${PROJECT_SOURCE_DIR}/platform/darwin/src/headless_backend_eagl.mm
${PROJECT_SOURCE_DIR}/platform/darwin/src/native_apple_interface.m
${PROJECT_SOURCE_DIR}/platform/darwin/src/http_file_source.mm
${PROJECT_SOURCE_DIR}/platform/darwin/src/native_apple_interface.m
@@ -37,7 +47,6 @@ target_sources(
${PROJECT_SOURCE_DIR}/platform/darwin/src/timer.cpp
${PROJECT_SOURCE_DIR}/platform/default/src/mbgl/gfx/headless_backend.cpp
${PROJECT_SOURCE_DIR}/platform/default/src/mbgl/gfx/headless_frontend.cpp
- ${PROJECT_SOURCE_DIR}/platform/default/src/mbgl/gl/headless_backend.cpp
${PROJECT_SOURCE_DIR}/platform/default/src/mbgl/map/map_snapshotter.cpp
${PROJECT_SOURCE_DIR}/platform/default/src/mbgl/storage/asset_file_source.cpp
${PROJECT_SOURCE_DIR}/platform/default/src/mbgl/storage/database_file_source.cpp
@@ -80,9 +89,7 @@ target_link_libraries(
"-framework CoreServices"
"-framework CoreText"
"-framework Foundation"
- "-framework GLKit"
"-framework ImageIO"
- "-framework OpenGLES"
"-framework QuartzCore"
"-framework Security"
"-framework SystemConfiguration"
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 75f91762a7..75d5ee3ef8 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -7,15 +7,10 @@ add_library(
${PROJECT_SOURCE_DIR}/test/api/annotations.test.cpp
${PROJECT_SOURCE_DIR}/test/api/api_misuse.test.cpp
${PROJECT_SOURCE_DIR}/test/api/custom_geometry_source.test.cpp
- ${PROJECT_SOURCE_DIR}/test/api/custom_layer.test.cpp
${PROJECT_SOURCE_DIR}/test/api/query.test.cpp
${PROJECT_SOURCE_DIR}/test/api/recycle_map.cpp
${PROJECT_SOURCE_DIR}/test/geometry/dem_data.test.cpp
${PROJECT_SOURCE_DIR}/test/geometry/line_atlas.test.cpp
- ${PROJECT_SOURCE_DIR}/test/gl/bucket.test.cpp
- ${PROJECT_SOURCE_DIR}/test/gl/context.test.cpp
- ${PROJECT_SOURCE_DIR}/test/gl/gl_functions.test.cpp
- ${PROJECT_SOURCE_DIR}/test/gl/object.test.cpp
${PROJECT_SOURCE_DIR}/test/map/map.test.cpp
${PROJECT_SOURCE_DIR}/test/map/prefetch.test.cpp
${PROJECT_SOURCE_DIR}/test/map/transform.test.cpp
@@ -24,7 +19,6 @@ add_library(
${PROJECT_SOURCE_DIR}/test/math/wrap.test.cpp
${PROJECT_SOURCE_DIR}/test/platform/settings.test.cpp
${PROJECT_SOURCE_DIR}/test/programs/symbol_program.test.cpp
- ${PROJECT_SOURCE_DIR}/test/renderer/backend_scope.test.cpp
${PROJECT_SOURCE_DIR}/test/renderer/image_manager.test.cpp
${PROJECT_SOURCE_DIR}/test/renderer/pattern_atlas.test.cpp
${PROJECT_SOURCE_DIR}/test/sprite/sprite_loader.test.cpp
@@ -96,7 +90,6 @@ add_library(
${PROJECT_SOURCE_DIR}/test/util/memory.test.cpp
${PROJECT_SOURCE_DIR}/test/util/merge_lines.test.cpp
${PROJECT_SOURCE_DIR}/test/util/number_conversions.test.cpp
- ${PROJECT_SOURCE_DIR}/test/util/offscreen_texture.test.cpp
${PROJECT_SOURCE_DIR}/test/util/pass.test.cpp
${PROJECT_SOURCE_DIR}/test/util/position.test.cpp
${PROJECT_SOURCE_DIR}/test/util/projection.test.cpp
@@ -113,6 +106,17 @@ add_library(
)
if(MBGL_WITH_OPENGL)
+ target_sources(
+ mbgl-test
+ PRIVATE
+ ${PROJECT_SOURCE_DIR}/test/api/custom_layer.test.cpp
+ ${PROJECT_SOURCE_DIR}/test/gl/bucket.test.cpp
+ ${PROJECT_SOURCE_DIR}/test/gl/context.test.cpp
+ ${PROJECT_SOURCE_DIR}/test/gl/gl_functions.test.cpp
+ ${PROJECT_SOURCE_DIR}/test/gl/object.test.cpp
+ ${PROJECT_SOURCE_DIR}/test/renderer/backend_scope.test.cpp
+ ${PROJECT_SOURCE_DIR}/test/util/offscreen_texture.test.cpp
+ )
target_compile_definitions(
mbgl-test
PRIVATE MBGL_RENDER_BACKEND_OPENGL=1