forked from wmcbrine/PDCurses
-
Notifications
You must be signed in to change notification settings - Fork 0
/
BUILD.bazel
67 lines (63 loc) · 1.48 KB
/
BUILD.bazel
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
load("@bazel_skylib//rules:copy_file.bzl", "copy_file")
load("@rules_cc//cc:defs.bzl", "cc_library")
copy_file(
name = "curses_h",
src = "curses.h",
out = "pdcurses_bazel_hdrs/curses.h",
)
copy_file(
name = "curspriv_h",
src = "curspriv.h",
out = "pdcurses_bazel_hdrs/curspriv.h",
)
copy_file(
name = "panel_h",
src = "panel.h",
out = "pdcurses_bazel_hdrs/panel.h",
)
cc_library(
name = "pdcurses",
srcs = glob([
"pdcurses/*.c",
"pdcurses/*.h",
"common/*.c",
]) + select({
"@platforms//os:windows": glob([
"wincon/*.c",
"wincon/*.h",
]),
"@platforms//os:linux": glob([
"x11/*.c",
"x11/*.h",
]),
}),
hdrs = glob([
"*.h",
"common/*.h",
"common/*.xpm",
]) + [
"pdcurses_bazel_hdrs/curses.h",
"pdcurses_bazel_hdrs/curspriv.h",
"pdcurses_bazel_hdrs/panel.h",
],
copts = select({
"@platforms//os:linux": ["-isystem /usr/include/X11"],
"//conditions:default": [],
}),
defines = ["NCURSES_CONST"],
includes = ["pdcurses_bazel_hdrs"],
linkopts = select({
"@platforms//os:windows": [
"-DEFAULTLIB:user32",
"-DEFAULTLIB:advapi32",
],
"@platforms//os:linux": [
"-lX11",
"-lXt",
"-lXpm",
"-lXmu",
"-lXaw",
],
}),
visibility = ["//visibility:public"],
)