This removes the GLFW_VULKAN_STATIC CMake option and the
_GLFW_VULKAN_STATIC configuration macro and replaces them with the
glfwInitVulkanLoader function, allowing a single library binary to
provide both behaviors.
This is based on the design from PR #1374 by @pmuetschard.
Closes#1374Closes#1890
This adds compile-time support for multiple platforms and runtime
detection of them. Window system related platform functions are now
called from shared code via the function pointer struct _GLFWplatform.
The timer, thread and module loading platform functions are still called
directly by name and the implementation chosen at link-time. These
functions are the same for any backend on a given OS, including the Null
backend.
The platforms are now enabled via CMake dependent options following the
GLFW_BUILD_<platform> pattern instead of a mix of automagic and ad-hoc
option names. There is no longer any option for the Null backend as it
is now always enabled.
Much of the struct stitching work in platform.h was based on an earlier
experimental branch for runtime platform selection by @ronchaine.
Every platform function related to windows, contexts, monitors, input,
event processing and Vulkan have been renamed so that multiple sets of
them can exist without colliding. Calls to these are now routed through
the _glfw.platform struct member. These changes makes up most of this
commit.
For Wayland and X11 the client library loading and display creation is
used to detect a running compositor/server. The XDG_SESSION_TYPE
environment variable is ignored for now, as X11 is still by far the more
complete implementation.
Closes#1655Closes#1958
This will be useful when building GLFW as a CMake object library and
linking it into a larger library that exports pkg-config information.
Partly based on #1307 by @a3f.
Closes#1307.
This adds the GLFW_LIBRARY_TYPE CMake cache variable, which allows users
and higher-level projects to set what type of library GLFW is built as.
When not empty, this value overrides the standard BUILD_SHARED_LIBS
option for GLFW while still allowing it to control the type of other
libraries in a larger project.
This also allows building GLFW as an object library without adding dummy
source files (as required by Xcode) or producing unused library
binaries.
Projects using CMake 3.12 or later can link the resulting GLFW object
library normally using target_link_libraries.
Fixes#279.
Related to #1307.
Closes#1497.
Closes#1574.
Closes#1928.
The insight to use wayland.xml to resolve the difficult-to-redirect
interface symbols was gleaned from SDL.
Instead of compiling the code output of wayland-scanner separately it is
made part of the wl_init compilation unit. This lets us do things like
transparently rename our copies of Wayland globals.
The OS version of wayland-client-protocol.h is no longer used by GLFW,
but it is presumably ABI compatible with the output of wayland-scanner.
Closes#1174.
Closes#1338.
Related to #1655.
Closes#1943.
This makes USE_MSVC_RUNTIME_LIBRARY_DLL update the directory scope
CMAKE_MSVC_RUNTIME_LIBRARY variable instead of CMAKE_C_FLAGS on CMake
3.15 and later.
Solution proposed by @moritz-h.
Fixes#1783.
Closes#1796.
This removes the final dependency on CoreVideo, using a display link to
get the refresh rate of monitors where Core Graphics report a refresh
rate of zero. Instead we now query the I/O registry directly, similarly
to what the display link does at creation.
Thanks to @OneSadCookie for pointers to this solution.
This will let higher-level projects override GLFW CMake options with
normal variables instead of having to use cache variables.
This means with CMake 3.13 and later you can now do:
set(GLFW_BUILD_TESTS ON)
add_subdirectory(path/to/glfw)
Instead of the more verbose:
set(GLFW_BUILD_TESTS ON CACHE BOOL "" FORCE)
add_subdirectory(path/to/glfw)
This changes the default value of the GLFW_BUILD_EXAMPLES and
GLFW_BUILD_TESTS CMake options to false when GLFW is being added as
a subdirectory by another CMake project.
If you want the previous behavior, force these options to true before
adding the GLFW subdirectory:
set(GLFW_BUILD_EXAMPLES ON CACHE BOOL "" FORCE)
set(GLFW_BUILD_TESTS ON CACHE BOOL "" FORCE)
add_subdirectory(path/to/glfw)
Doing this is backward compatible with earlier versions of GLFW.
The GLFW_BUILD_DOCS option is left enabled as it also requires Doxygen
to have any effect, is quicker to build and is more likely to be useful
when GLFW is a subproject.
This removes all dependencies from the GLFW test programs on the Vulkan
SDK.
It also removes support for linking the GLFW shared library (dynamic
library, DLL) against the Vulkan loader static library.