mirror of
https://github.com/glfw/glfw.git
synced 2025-06-07 16:24:57 +00:00
Fix compilation on Linux without X11 and Wayland
In file news.dox it is mentioned that it should be possible to disable both X11 and Wayland backends to compile GLFW with only null platform. This actually does not compile due to missing definintion of clockid_t and CLOCK_REALTIME. This commit fixes compilation errors.
This commit is contained in:
parent
3ed6e9d89a
commit
708a48ca36
@ -316,10 +316,8 @@ if (MSVC90)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Workaround for -std=c99 on Linux disabling _DEFAULT_SOURCE (POSIX 2008 and more)
|
# Workaround for -std=c99 on Linux disabling _DEFAULT_SOURCE (POSIX 2008 and more)
|
||||||
if (GLFW_BUILD_X11 OR GLFW_BUILD_WAYLAND)
|
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||||
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
|
||||||
target_compile_definitions(glfw PRIVATE _DEFAULT_SOURCE)
|
target_compile_definitions(glfw PRIVATE _DEFAULT_SOURCE)
|
||||||
endif()
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (GLFW_BUILD_SHARED_LIBRARY)
|
if (GLFW_BUILD_SHARED_LIBRARY)
|
||||||
|
@ -29,6 +29,7 @@
|
|||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
#include <sys/types.h>
|
||||||
|
|
||||||
|
|
||||||
// POSIX-specific global timer data
|
// POSIX-specific global timer data
|
||||||
|
Loading…
Reference in New Issue
Block a user