summaryrefslogtreecommitdiff
path: root/vendor/glfw.cmake
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2018-11-20 16:45:53 +0100
committerKonstantin Käfer <mail@kkaefer.com>2018-11-21 10:12:59 +0100
commitf30429832e78600b8100a812fb50bcf1b949d567 (patch)
tree567c4a57b6167e8b4cb4ec81221843ff4de22385 /vendor/glfw.cmake
parent53bbf9d6991c1eddfa141ddcfb4b7252874e46ec (diff)
downloadqtlocation-mapboxgl-f30429832e78600b8100a812fb50bcf1b949d567.tar.gz
[build] use GLFW as a submodule and update to most recent version
this fixes https://github.com/glfw/glfw/issues/1334 for macOS Mojave
Diffstat (limited to 'vendor/glfw.cmake')
-rw-r--r--vendor/glfw.cmake24
1 files changed, 24 insertions, 0 deletions
diff --git a/vendor/glfw.cmake b/vendor/glfw.cmake
new file mode 100644
index 0000000000..e99ecc86b1
--- /dev/null
+++ b/vendor/glfw.cmake
@@ -0,0 +1,24 @@
+set(GLFW_BUILD_EXAMPLES OFF CACHE BOOL "Build the GLFW example programs" FORCE)
+set(GLFW_BUILD_TESTS OFF CACHE BOOL "Build the GLFW test programs" FORCE)
+set(GLFW_BUILD_DOCS OFF CACHE BOOL "Build the GLFW documentation" FORCE)
+set(GLFW_INSTALL OFF CACHE BOOL "Generate installation target" FORCE)
+
+unset(CMAKE_C_VISIBILITY_PRESET)
+add_subdirectory(vendor/glfw)
+set(CMAKE_C_VISIBILITY_PRESET hidden)
+
+target_compile_options(glfw PRIVATE -Wno-shadow -Wno-unused-parameter -Wno-sign-compare -Wno-missing-field-initializers)
+
+if(APPLE)
+ # Don't show OpenGL deprecation warnings.
+ target_compile_options(glfw PRIVATE -Wno-deprecated-declarations -Wno-unguarded-availability-new)
+
+ # get_target_property(DEPLOYMENT_TARGET_VERSION glfw MACOSX_DEPLOYMENT_TARGET)
+ # message(STATUS "target: ${DEPLOYMENT_TARGET_VERSION}")
+ set_target_properties(glfw PROPERTIES OSX_DEPLOYMENT_TARGET 10.11)
+endif()
+
+if(CMAKE_GENERATOR STREQUAL "Xcode")
+ # The Xcode generator always tries to link from this directory instead of the actual output dir.
+ set_target_properties(glfw PROPERTIES ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/$<CONFIG>")
+endif()