summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuha Alanen <juha.alanen@mapbox.com>2020-03-09 10:52:51 +0200
committerJuha Alanen <juha.alanen@mapbox.com>2020-03-12 13:28:10 +0200
commit7333d58dab898280d9ea33535e3a3e3a0d596952 (patch)
tree9731a6ab9c7531c460a5ce88e58893c932782fcb
parentcf7bffb0ff69056a45a2517c7824aec54a0d6968 (diff)
downloadqtlocation-mapboxgl-7333d58dab898280d9ea33535e3a3e3a0d596952.tar.gz
[glfw] Add OpenGL files only when the flag is enabled
-rw-r--r--platform/glfw/CMakeLists.txt16
1 files changed, 14 insertions, 2 deletions
diff --git a/platform/glfw/CMakeLists.txt b/platform/glfw/CMakeLists.txt
index 93df7d58a4..dd7fd306a0 100644
--- a/platform/glfw/CMakeLists.txt
+++ b/platform/glfw/CMakeLists.txt
@@ -7,13 +7,19 @@ add_executable(
mbgl-glfw
${PROJECT_SOURCE_DIR}/platform/glfw/main.cpp
${PROJECT_SOURCE_DIR}/platform/glfw/glfw_view.cpp
- ${PROJECT_SOURCE_DIR}/platform/glfw/glfw_gl_backend.cpp
${PROJECT_SOURCE_DIR}/platform/glfw/glfw_renderer_frontend.cpp
${PROJECT_SOURCE_DIR}/platform/glfw/settings_json.cpp
${PROJECT_SOURCE_DIR}/platform/glfw/test_writer.cpp
${PROJECT_SOURCE_DIR}/platform/default/src/mbgl/map/map_snapshotter.cpp
)
+if(MBGL_WITH_OPENGL)
+ target_sources(
+ mbgl-glfw
+ PRIVATE ${PROJECT_SOURCE_DIR}/platform/glfw/glfw_gl_backend.cpp
+ )
+endif()
+
target_include_directories(
mbgl-glfw
PRIVATE
@@ -38,11 +44,17 @@ target_link_libraries(
Mapbox::Base::Extras::filesystem
Mapbox::Base::Extras::rapidjson
Mapbox::Map
- OpenGL::GL
mbgl-compiler-options
mbgl-vendor-cheap-ruler-cpp
)
+if(MBGL_WITH_OPENGL)
+ target_link_libraries(
+ mbgl-glfw
+ PRIVATE OpenGL::GL
+ )
+endif()
+
set_property(TARGET mbgl-glfw PROPERTY FOLDER Executables)
install(TARGETS mbgl-glfw RUNTIME DESTINATION bin)