Skip to content

Commit a2ca6cd

Browse files
committed
Add glfw as subdirectory
1 parent d9a8589 commit a2ca6cd

File tree

170 files changed

+120492
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

170 files changed

+120492
-0
lines changed

glfw/.appveyor.yml

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
image:
2+
- Visual Studio 2015
3+
branches:
4+
only:
5+
- ci
6+
- master
7+
- latest
8+
- 3.3-stable
9+
skip_tags: true
10+
environment:
11+
matrix:
12+
- GENERATOR: MinGW Makefiles
13+
BUILD_SHARED_LIBS: ON
14+
CFLAGS: -Werror
15+
- GENERATOR: MinGW Makefiles
16+
BUILD_SHARED_LIBS: OFF
17+
CFLAGS: -Werror
18+
- GENERATOR: Visual Studio 12 2013
19+
BUILD_SHARED_LIBS: ON
20+
CFLAGS: /WX
21+
- GENERATOR: Visual Studio 12 2013
22+
BUILD_SHARED_LIBS: OFF
23+
CFLAGS: /WX
24+
matrix:
25+
fast_finish: true
26+
for:
27+
-
28+
matrix:
29+
only:
30+
- GENERATOR: MinGW Makefiles
31+
build_script:
32+
- set PATH=%PATH:C:\Program Files\Git\usr\bin=C:\MinGW\bin%
33+
- cmake -B build -G "%GENERATOR%" -DBUILD_SHARED_LIBS=%BUILD_SHARED_LIBS%
34+
- cmake --build build
35+
-
36+
matrix:
37+
only:
38+
- GENERATOR: Visual Studio 12 2013
39+
build_script:
40+
- cmake -B build -G "%GENERATOR%" -DBUILD_SHARED_LIBS=%BUILD_SHARED_LIBS%
41+
- cmake --build build --target glfw
42+
notifications:
43+
- provider: Email
44+
to:
45+
46+
on_build_failure: true
47+
on_build_success: false

glfw/.editorconfig

+67
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# EditorConfig for GLFW and its internal dependencies
2+
#
3+
# All files created by GLFW should indent with four spaces unless their format requires
4+
# otherwise. A few files still use other indent styles for historical reasons.
5+
#
6+
# Dependencies have (what seemed to be) their existing styles described. Those with
7+
# existing trailing whitespace have it preserved to avoid cluttering future commits.
8+
9+
root = true
10+
11+
[*]
12+
charset = utf-8
13+
end_of_line = lf
14+
15+
[include/GLFW/*.h]
16+
indent_style = space
17+
indent_size = 4
18+
19+
[{src,examples,tests}/*.{c,m,h,rc,in}]
20+
indent_style = space
21+
indent_size = 4
22+
23+
[CMakeLists.txt]
24+
indent_style = space
25+
indent_size = 4
26+
27+
[CMake/**.{cmake,in}]
28+
indent_style = space
29+
indent_size = 4
30+
31+
[*.{md}]
32+
indent_style = space
33+
indent_size = 4
34+
trim_trailing_whitespace = false
35+
36+
[DoxygenLayout.xml]
37+
indent_style = space
38+
indent_size = 2
39+
40+
[docs/*.{scss,html}]
41+
indent_style = tab
42+
indent_size = unset
43+
44+
[deps/mingw/*.h]
45+
indent_style = space
46+
indent_size = 4
47+
tab_width = 8
48+
trim_trailing_whitespace = false
49+
50+
[deps/getopt.{c,h}]
51+
indent_style = space
52+
indent_size = 2
53+
54+
[deps/linmath.h]
55+
indent_style = tab
56+
tab_width = 4
57+
indent_size = 4
58+
trim_trailing_whitespace = false
59+
60+
[deps/nuklear*.h]
61+
indent_style = space
62+
indent_size = 4
63+
64+
[deps/tinycthread.{c,h}]
65+
indent_style = space
66+
indent_size = 2
67+

glfw/.gitattributes

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
*.m linguist-language=Objective-C
2+
.gitignore export-ignore
3+
.gitattributes export-ignore
4+
.travis.yml export-ignore
5+
.appveyor.yml export-ignore

glfw/.github/CODEOWNERS

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
2+
* @elmindreda
3+
4+
docs/*.css @glfw/webdev
5+
docs/*.scss @glfw/webdev
6+
docs/*.html @glfw/webdev
7+
docs/*.xml @glfw/webdev
8+

glfw/.github/workflows/build.yml

+100
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
name: Build
2+
on:
3+
pull_request:
4+
push:
5+
branches: [ ci, master, latest, 3.3-stable ]
6+
workflow_dispatch:
7+
permissions:
8+
statuses: write
9+
contents: read
10+
11+
jobs:
12+
build-linux-clang:
13+
name: Linux (Clang)
14+
runs-on: ubuntu-latest
15+
timeout-minutes: 4
16+
env:
17+
CC: clang
18+
CFLAGS: -Werror
19+
steps:
20+
- uses: actions/checkout@v4
21+
- name: Install dependencies
22+
run: |
23+
sudo apt update
24+
sudo apt install libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libxext-dev libwayland-dev libxkbcommon-dev
25+
26+
- name: Configure Null shared library
27+
run: cmake -B build-null-shared -D GLFW_BUILD_WAYLAND=OFF -D GLFW_BUILD_X11=OFF -D BUILD_SHARED_LIBS=ON
28+
- name: Build Null shared library
29+
run: cmake --build build-null-shared --parallel
30+
31+
- name: Configure X11 shared library
32+
run: cmake -B build-x11-shared -D GLFW_BUILD_WAYLAND=OFF -D GLFW_BUILD_X11=ON -D BUILD_SHARED_LIBS=ON
33+
- name: Build X11 shared library
34+
run: cmake --build build-x11-shared --parallel
35+
36+
- name: Configure Wayland shared library
37+
run: cmake -B build-wayland-shared -D GLFW_BUILD_WAYLAND=ON -D GLFW_BUILD_X11=OFF -D BUILD_SHARED_LIBS=ON
38+
- name: Build Wayland shared library
39+
run: cmake --build build-wayland-shared --parallel
40+
41+
- name: Configure Wayland+X11 static library
42+
run: cmake -B build-full-static -D GLFW_BUILD_WAYLAND=ON -D GLFW_BUILD_X11=ON
43+
- name: Build Wayland+X11 static library
44+
run: cmake --build build-full-static --parallel
45+
46+
- name: Configure Wayland+X11 shared library
47+
run: cmake -B build-full-shared -D GLFW_BUILD_WAYLAND=ON -D BUILD_SHARED_LIBS=ON -D GLFW_BUILD_X11=ON
48+
- name: Build Wayland+X11 shared library
49+
run: cmake --build build-full-shared --parallel
50+
51+
build-macos-clang:
52+
name: macOS (Clang)
53+
runs-on: macos-latest
54+
timeout-minutes: 4
55+
env:
56+
CFLAGS: -Werror
57+
MACOSX_DEPLOYMENT_TARGET: 10.8
58+
CMAKE_OSX_ARCHITECTURES: x86_64;arm64
59+
steps:
60+
- uses: actions/checkout@v4
61+
62+
- name: Configure Null shared library
63+
run: cmake -B build-null-shared -D GLFW_BUILD_COCOA=OFF -D BUILD_SHARED_LIBS=ON
64+
- name: Build Null shared library
65+
run: cmake --build build-null-shared --parallel
66+
67+
- name: Configure Cocoa static library
68+
run: cmake -B build-cocoa-static
69+
- name: Build Cocoa static library
70+
run: cmake --build build-cocoa-static --parallel
71+
72+
- name: Configure Cocoa shared library
73+
run: cmake -B build-cocoa-shared -D BUILD_SHARED_LIBS=ON
74+
- name: Build Cocoa shared library
75+
run: cmake --build build-cocoa-shared --parallel
76+
77+
build-windows-vs2022:
78+
name: Windows (VS2022)
79+
runs-on: windows-latest
80+
timeout-minutes: 4
81+
env:
82+
CFLAGS: /WX
83+
steps:
84+
- uses: actions/checkout@v4
85+
86+
- name: Configure Win32 shared x86 library
87+
run: cmake -B build-win32-shared-x86 -G "Visual Studio 17 2022" -A Win32 -D BUILD_SHARED_LIBS=ON
88+
- name: Build Win32 shared x86 library
89+
run: cmake --build build-win32-shared-x86 --parallel
90+
91+
- name: Configure Win32 static x64 library
92+
run: cmake -B build-win32-static-x64 -G "Visual Studio 17 2022" -A x64
93+
- name: Build Win32 static x64 library
94+
run: cmake --build build-win32-static-x64 --parallel
95+
96+
- name: Configure Win32 shared x64 library
97+
run: cmake -B build-win32-shared-x64 -G "Visual Studio 17 2022" -A x64 -D BUILD_SHARED_LIBS=ON
98+
- name: Build Win32 shared x64 library
99+
run: cmake --build build-win32-shared-x64 --parallel
100+

glfw/.gitignore

+104
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
# The canonical out-of-tree build subdirectory
2+
build
3+
build-*
4+
5+
# Visual Studio clutter
6+
_ReSharper*
7+
*.sdf
8+
*.suo
9+
*.dir
10+
*.vcxproj*
11+
*.sln
12+
.vs
13+
CMakeSettings.json
14+
Win32
15+
x64
16+
Debug
17+
Release
18+
MinSizeRel
19+
RelWithDebInfo
20+
*.opensdf
21+
22+
# Xcode clutter
23+
GLFW.build
24+
GLFW.xcodeproj
25+
26+
# macOS clutter
27+
.DS_Store
28+
29+
# Makefile generator clutter
30+
Makefile
31+
32+
# Ninja generator clutter
33+
build.ninja
34+
rules.ninja
35+
.ninja_deps
36+
.ninja_log
37+
38+
# CMake clutter
39+
CMakeCache.txt
40+
CMakeFiles
41+
CMakeScripts
42+
CMakeDoxyfile.in
43+
CMakeDoxygenDefaults.cmake
44+
cmake_install.cmake
45+
cmake_uninstall.cmake
46+
47+
# Generated files
48+
docs/Doxyfile
49+
docs/html
50+
docs/warnings.txt
51+
docs/doxygen_sqlite3.db
52+
src/glfw_config.h
53+
src/glfw3.pc
54+
src/glfw3Config.cmake
55+
src/glfw3ConfigVersion.cmake
56+
57+
# Compiled binaries
58+
src/libglfw.so
59+
src/libglfw.so.3
60+
src/libglfw.so.3.5
61+
src/libglfw.dylib
62+
src/libglfw.dylib
63+
src/libglfw.3.dylib
64+
src/libglfw.3.5.dylib
65+
src/libglfw3.a
66+
src/glfw3.lib
67+
src/glfw3.dll
68+
src/glfw3dll.lib
69+
src/libglfw3dll.a
70+
examples/*.app
71+
examples/*.exe
72+
examples/boing
73+
examples/gears
74+
examples/heightmap
75+
examples/offscreen
76+
examples/particles
77+
examples/splitview
78+
examples/sharing
79+
examples/triangle-opengl
80+
examples/wave
81+
examples/windows
82+
tests/*.app
83+
tests/*.exe
84+
tests/clipboard
85+
tests/cursor
86+
tests/empty
87+
tests/events
88+
tests/gamma
89+
tests/glfwinfo
90+
tests/icon
91+
tests/iconify
92+
tests/inputlag
93+
tests/joysticks
94+
tests/monitors
95+
tests/msaa
96+
tests/reopen
97+
tests/tearing
98+
tests/threads
99+
tests/timeout
100+
tests/title
101+
tests/triangle-vulkan
102+
tests/window
103+
tests/windows
104+

glfw/.mailmap

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
2+
3+
Camilla Löwy <[email protected]>
4+
5+
Emmanuel Gil Peyrot <[email protected]>
6+
7+
8+
Marcus Geelnard <[email protected]> <marcus@geelnards-pc.(none)>
9+
Marcus Geelnard <[email protected]>
10+

glfw/CMake/GenerateMappings.cmake

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Usage:
2+
# cmake -P GenerateMappings.cmake <path/to/mappings.h.in> <path/to/mappings.h>
3+
4+
set(source_url "https://raw.githubusercontent.com/gabomdq/SDL_GameControllerDB/master/gamecontrollerdb.txt")
5+
set(source_path "${CMAKE_CURRENT_BINARY_DIR}/gamecontrollerdb.txt")
6+
set(template_path "${CMAKE_ARGV3}")
7+
set(target_path "${CMAKE_ARGV4}")
8+
9+
if (NOT EXISTS "${template_path}")
10+
message(FATAL_ERROR "Failed to find template file ${template_path}")
11+
endif()
12+
13+
file(DOWNLOAD "${source_url}" "${source_path}"
14+
STATUS download_status
15+
TLS_VERIFY on)
16+
17+
list(GET download_status 0 status_code)
18+
list(GET download_status 1 status_message)
19+
20+
if (status_code)
21+
message(FATAL_ERROR "Failed to download ${source_url}: ${status_message}")
22+
endif()
23+
24+
file(STRINGS "${source_path}" lines)
25+
foreach(line ${lines})
26+
if (line MATCHES "^[0-9a-fA-F]")
27+
if (line MATCHES "platform:Windows")
28+
if (GLFW_WIN32_MAPPINGS)
29+
string(APPEND GLFW_WIN32_MAPPINGS "\n")
30+
endif()
31+
string(APPEND GLFW_WIN32_MAPPINGS "\"${line}\",")
32+
elseif (line MATCHES "platform:Mac OS X")
33+
if (GLFW_COCOA_MAPPINGS)
34+
string(APPEND GLFW_COCOA_MAPPINGS "\n")
35+
endif()
36+
string(APPEND GLFW_COCOA_MAPPINGS "\"${line}\",")
37+
elseif (line MATCHES "platform:Linux")
38+
if (GLFW_LINUX_MAPPINGS)
39+
string(APPEND GLFW_LINUX_MAPPINGS "\n")
40+
endif()
41+
string(APPEND GLFW_LINUX_MAPPINGS "\"${line}\",")
42+
endif()
43+
endif()
44+
endforeach()
45+
46+
configure_file("${template_path}" "${target_path}" @ONLY NEWLINE_STYLE UNIX)
47+
file(REMOVE "${source_path}")
48+

0 commit comments

Comments
 (0)