Skip to content

Commit

Permalink
Update to GLFW 3.3.9
Browse files Browse the repository at this point in the history
  • Loading branch information
tek256 committed Dec 23, 2023
1 parent f406ead commit 83c11be
Show file tree
Hide file tree
Showing 95 changed files with 48,799 additions and 4,458 deletions.
19 changes: 17 additions & 2 deletions dep/glfw/CMake/GenerateMappings.cmake 100755 → 100644
Expand Up @@ -23,8 +23,23 @@ endif()

file(STRINGS "${source_path}" lines)
foreach(line ${lines})
if ("${line}" MATCHES "^[0-9a-fA-F].*$")
set(GLFW_GAMEPAD_MAPPINGS "${GLFW_GAMEPAD_MAPPINGS}\"${line}\",\n")
if (line MATCHES "^[0-9a-fA-F]")
if (line MATCHES "platform:Windows")
if (GLFW_WIN32_MAPPINGS)
set(GLFW_WIN32_MAPPINGS "${GLFW_WIN32_MAPPINGS}\n")
endif()
set(GLFW_WIN32_MAPPINGS "${GLFW_WIN32_MAPPINGS}\"${line}\",")
elseif (line MATCHES "platform:Mac OS X")
if (GLFW_COCOA_MAPPINGS)
set(GLFW_COCOA_MAPPINGS "${GLFW_COCOA_MAPPINGS}\n")
endif()
set(GLFW_COCOA_MAPPINGS "${GLFW_COCOA_MAPPINGS}\"${line}\",")
elseif (line MATCHES "platform:Linux")
if (GLFW_LINUX_MAPPINGS)
set(GLFW_LINUX_MAPPINGS "${GLFW_LINUX_MAPPINGS}\n")
endif()
set(GLFW_LINUX_MAPPINGS "${GLFW_LINUX_MAPPINGS}\"${line}\",")
endif()
endif()
endforeach()

Expand Down
Empty file modified dep/glfw/CMake/MacOSXBundleInfo.plist.in 100755 → 100644
Empty file.
Empty file modified dep/glfw/CMake/i686-w64-mingw32-clang.cmake 100755 → 100644
Empty file.
Empty file modified dep/glfw/CMake/i686-w64-mingw32.cmake 100755 → 100644
Empty file.
2 changes: 1 addition & 1 deletion dep/glfw/CMake/modules/FindEpollShim.cmake 100755 → 100644
Expand Up @@ -13,5 +13,5 @@ if (EPOLLSHIM_INCLUDE_DIRS AND EPOLLSHIM_LIBRARIES)
endif (EPOLLSHIM_INCLUDE_DIRS AND EPOLLSHIM_LIBRARIES)

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(EPOLLSHIM DEFAULT_MSG EPOLLSHIM_LIBRARIES EPOLLSHIM_INCLUDE_DIRS)
find_package_handle_standard_args(EpollShim DEFAULT_MSG EPOLLSHIM_LIBRARIES EPOLLSHIM_INCLUDE_DIRS)
mark_as_advanced(EPOLLSHIM_INCLUDE_DIRS EPOLLSHIM_LIBRARIES)
Empty file modified dep/glfw/CMake/modules/FindOSMesa.cmake 100755 → 100644
Empty file.
Empty file modified dep/glfw/CMake/modules/FindWaylandProtocols.cmake 100755 → 100644
Empty file.
Empty file modified dep/glfw/CMake/modules/FindXKBCommon.cmake 100755 → 100644
Empty file.
Empty file modified dep/glfw/CMake/x86_64-w64-mingw32-clang.cmake 100755 → 100644
Empty file.
Empty file modified dep/glfw/CMake/x86_64-w64-mingw32.cmake 100755 → 100644
Empty file.
44 changes: 29 additions & 15 deletions dep/glfw/CMakeLists.txt 100755 → 100644
@@ -1,23 +1,25 @@
cmake_minimum_required(VERSION 3.0)
cmake_minimum_required(VERSION 3.0...3.20 FATAL_ERROR)

project(GLFW VERSION 3.3.2 LANGUAGES C)

set(CMAKE_LEGACY_CYGWIN_WIN32 OFF)
project(GLFW VERSION 3.3.9 LANGUAGES C)

if (POLICY CMP0054)
cmake_policy(SET CMP0054 NEW)
endif()

if (POLICY CMP0069)
cmake_policy(SET CMP0069 NEW)
endif()

if (POLICY CMP0077)
cmake_policy(SET CMP0077 NEW)
endif()

set_property(GLOBAL PROPERTY USE_FOLDERS ON)

option(BUILD_SHARED_LIBS "Build shared libraries" ON)
option(GLFW_BUILD_EXAMPLES "Build the GLFW example programs" OFF)
option(GLFW_BUILD_TESTS "Build the GLFW test programs" OFF)
option(GLFW_BUILD_DOCS "Build the GLFW documentation" OFF)
option(BUILD_SHARED_LIBS "Build shared libraries" OFF)
option(GLFW_BUILD_EXAMPLES "Build the GLFW example programs" ON)
option(GLFW_BUILD_TESTS "Build the GLFW test programs" ON)
option(GLFW_BUILD_DOCS "Build the GLFW documentation" ON)
option(GLFW_INSTALL "Generate installation target" ON)
option(GLFW_VULKAN_STATIC "Assume the Vulkan loader is linked with the application" OFF)

Expand All @@ -43,6 +45,7 @@ if (BUILD_SHARED_LIBS AND UNIX)
else()
set(GLFW_LIB_NAME glfw3)
endif()
set(GLFW_LIB_NAME_SUFFIX "")

if (GLFW_VULKAN_STATIC)
if (BUILD_SHARED_LIBS)
Expand All @@ -63,7 +66,8 @@ if (GLFW_BUILD_DOCS)
endif()

#--------------------------------------------------------------------
# Set compiler specific flags
# Apply Microsoft C runtime library option
# This is here because it also applies to tests and examples
#--------------------------------------------------------------------
if (MSVC)
if (MSVC90)
Expand All @@ -76,22 +80,26 @@ if (MSVC)
# Workaround for VS 2008 not shipping with stdint.h
list(APPEND glfw_INCLUDE_DIRS "${GLFW_SOURCE_DIR}/deps/vs2008")
endif()
endif()

if (NOT USE_MSVC_RUNTIME_LIBRARY_DLL)
if (MSVC AND NOT USE_MSVC_RUNTIME_LIBRARY_DLL)
if (CMAKE_VERSION VERSION_LESS 3.15)
foreach (flag CMAKE_C_FLAGS
CMAKE_C_FLAGS_DEBUG
CMAKE_C_FLAGS_RELEASE
CMAKE_C_FLAGS_MINSIZEREL
CMAKE_C_FLAGS_RELWITHDEBINFO)

if (${flag} MATCHES "/MD")
if (flag MATCHES "/MD")
string(REGEX REPLACE "/MD" "/MT" ${flag} "${${flag}}")
endif()
if (${flag} MATCHES "/MDd")
if (flag MATCHES "/MDd")
string(REGEX REPLACE "/MDd" "/MTd" ${flag} "${${flag}}")
endif()

endforeach()
else()
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
endif()
endif()

Expand Down Expand Up @@ -128,6 +136,9 @@ if (MINGW)
if (_GLFW_HAS_64ASLR)
set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--high-entropy-va ${CMAKE_SHARED_LINKER_FLAGS}")
endif()

# Clear flags again to avoid breaking later tests
set(CMAKE_REQUIRED_FLAGS)
endif()

#--------------------------------------------------------------------
Expand Down Expand Up @@ -186,6 +197,10 @@ if (_GLFW_WIN32)
if (GLFW_USE_HYBRID_HPG)
set(_GLFW_USE_HYBRID_HPG 1)
endif()

if (BUILD_SHARED_LIBS)
set (GLFW_LIB_NAME_SUFFIX "dll")
endif()
endif()

#--------------------------------------------------------------------
Expand Down Expand Up @@ -244,7 +259,7 @@ if (_GLFW_WAYLAND)
find_package(WaylandScanner REQUIRED)
find_package(WaylandProtocols 1.15 REQUIRED)

list(APPEND glfw_PKG_DEPS "wayland-egl")
list(APPEND glfw_PKG_DEPS "wayland-client")

list(APPEND glfw_INCLUDE_DIRS "${Wayland_INCLUDE_DIRS}")
list(APPEND glfw_LIBRARIES "${Wayland_LIBRARIES}" "${CMAKE_THREAD_LIBS_INIT}")
Expand All @@ -254,10 +269,9 @@ if (_GLFW_WAYLAND)

include(CheckIncludeFiles)
include(CheckFunctionExists)
check_include_files(xkbcommon/xkbcommon-compose.h HAVE_XKBCOMMON_COMPOSE_H)
check_function_exists(memfd_create HAVE_MEMFD_CREATE)

if (NOT ("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux"))
if (NOT CMAKE_SYSTEM_NAME STREQUAL "Linux")
find_package(EpollShim)
if (EPOLLSHIM_FOUND)
list(APPEND glfw_INCLUDE_DIRS "${EPOLLSHIM_INCLUDE_DIRS}")
Expand Down

0 comments on commit 83c11be

Please sign in to comment.