[build] Build files related to OpenGL renderer only when the flag is enabled
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user