-
Notifications
You must be signed in to change notification settings - Fork 27
/
BUILD.libsdlgfx
53 lines (49 loc) · 1.18 KB
/
BUILD.libsdlgfx
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
# -*-Python-*-
config_setting(
name = "darwin",
values = {"host_cpu": "darwin"}
)
cc_library(
name = "sdlgfx",
srcs = [
"SDL_framerate.c",
"SDL_gfxPrimitives.c",
"SDL_gfxBlitFunc.c",
"SDL_imageFilter.c",
"SDL_rotozoom.c",
] + glob(["*.h"]),
hdrs = select({
"//conditions:default": ["SDL/" + i for i in glob(["*.h"])],
":darwin": ["SDL_gfx/" + i for i in glob(["*.h"])],
}),
includes = [
".", "SDL", "SDL_gfx",
],
deps = [
"@libsdl12//:sdl",
],
visibility = ["//visibility:public"],
linkstatic = 1,
)
genrule(
name = "sdlgfxheaders",
srcs = glob(["*.h"]),
outs = ["SDL/" + i for i in glob(["*.h"])],
cmd = "\n".join([
"mkdir -p $(@D)/SDL",
"for i in $(SRCS) ; do",
" cp \"$$i\" \"$(@D)/SDL/$$(basename \"$${i}\")\"",
"done",
]),
)
genrule(
name = "sdlgfxheaders_mac",
srcs = glob(["*.h"]),
outs = ["SDL_gfx/" + i for i in glob(["*.h"])],
cmd = "\n".join([
"mkdir -p $(@D)/SDL",
"for i in $(SRCS) ; do",
" cp \"$$i\" \"$(@D)/SDL_gfx/$$(basename \"$${i}\")\"",
"done",
]),
)