forked from glfw/glfw
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathBUCK
138 lines (117 loc) · 2.69 KB
/
BUCK
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
load('//:buckaroo_macros.bzl', 'buckaroo_deps_from_package')
load('//:subdir_glob.bzl', 'subdir_glob')
null_srcs = glob([
'src/**/null_*.c',
])
macos_srcs = glob([
'src/cocoa_*.c',
'src/cocoa_*.m',
'src/nsgl_*.m',
'src/posix_tls.c',
'src/vulkan.c',
])
linux_srcs = glob([
'src/linux_*.c',
])
posix_srcs = glob([
'src/posix_*.c',
])
mir_srcs = glob([
'src/mir_*.c',
])
egl_srcs = glob([
'src/egl_*.c',
])
x11_srcs = glob([
'src/x11_*.c',
])
glx_srcs = glob([
'src/glx_*.c',
])
wgl_srcs = glob([
'src/wgl_*.c',
])
wl_srcs = glob([
'src/wl_*.c',
])
windows_srcs = glob([
'src/win32_*.c',
])
vulkan_srcs = glob([
'src/vulkan.c',
])
platform_srcs = \
null_srcs + macos_srcs + windows_srcs + linux_srcs + \
posix_srcs + mir_srcs + x11_srcs + glx_srcs + \
egl_srcs + wgl_srcs + wl_srcs + vulkan_srcs
macos_flags = [
'-D_GLFW_COCOA',
'-D_GLFW_USE_MENUBAR',
'-D_GLFW_USE_RETINA',
]
linux_flags = [
'-D_GLFW_X11',
]
windows_flags = [
'-D_GLFW_WIN32',
]
macos_exported_linker_flags = [
'-framework', 'Cocoa',
'-framework', 'IOKit',
'-framework', 'CoreVideo',
]
windows_exported_linker_flags = [
'User32.lib',
'Gdi32.lib',
'Shell32.lib',
]
linux_deps = \
buckaroo_deps_from_package('github.com/buckaroo-pm/pkg-config-gl') + \
buckaroo_deps_from_package('github.com/buckaroo-pm/pkg-config-x11') + \
buckaroo_deps_from_package('github.com/buckaroo-pm/host-dl') + \
buckaroo_deps_from_package('github.com/buckaroo-pm/host-pthread')
macos_deps = \
buckaroo_deps_from_package('github.com/buckaroo-pm/host-cocoa') + \
buckaroo_deps_from_package('github.com/buckaroo-pm/host-io-kit') + \
buckaroo_deps_from_package('github.com/buckaroo-pm/host-core-foundation') + \
buckaroo_deps_from_package('github.com/buckaroo-pm/host-core-video')
cxx_library(
name = 'glfw',
header_namespace = '',
exported_headers = subdir_glob([
('include', 'GLFW/*.h'),
]),
headers = subdir_glob([
('src', '*/*.h'),
]),
srcs = glob([
'src/**/*.c',
], exclude = platform_srcs),
platform_srcs = [
('linux.*', linux_srcs + posix_srcs + x11_srcs + egl_srcs + glx_srcs + vulkan_srcs),
('macos.*', macos_srcs),
('windows.*', windows_srcs + egl_srcs + wgl_srcs + vulkan_srcs),
],
compiler_flags = [
'-D_GLFW_BUILD_DLL',
],
platform_compiler_flags = [
('^macos.*', macos_flags),
('^linux.*', linux_flags),
('^windows.*', windows_flags),
],
exported_platform_linker_flags = [
('^macos.*', macos_exported_linker_flags),
('^windows.*', windows_exported_linker_flags),
],
platform_deps = [
('linux.*', linux_deps),
('macos.*', macos_deps),
],
licenses = [
'LICENSE.md',
],
visibility = [
'PUBLIC',
],
)