summaryrefslogtreecommitdiff
path: root/platform/glfw
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 15:24:37 +0200
commitcd320d8591454c02cc06b6c84b423e5a83de7098 (patch)
treed9ade660f8c25d510e7ba09807ebeb873d886a47 /platform/glfw
parent96e32717c07d6c3986db0d9562f11e927a3aa97d (diff)
downloadqtlocation-mapboxgl-cd320d8591454c02cc06b6c84b423e5a83de7098.tar.gz
[glfw] Add OpenGL files only when the flag is enabled
Diffstat (limited to 'platform/glfw')
-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)