forked from nelhage/rules_boost
-
Notifications
You must be signed in to change notification settings - Fork 0
/
BUILD.lzma
158 lines (152 loc) · 5.83 KB
/
BUILD.lzma
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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
# Description
# lzma is a general purpose data compression library https://tukaani.org/xz/
# Public Domain
load("@bazel_skylib//rules:copy_file.bzl", "copy_file")
config_setting(
name = "linux",
constraint_values = ["@bazel_tools//platforms:linux"],
)
config_setting(
name = "osx",
constraint_values = ["@bazel_tools//platforms:osx"],
)
config_setting(
name = "windows",
constraint_values = ["@bazel_tools//platforms:windows"],
)
copy_file(
name = "copy_config",
src = select({
":linux": "@com_github_nelhage_rules_boost//:config.lzma-linux.h",
":osx": "@com_github_nelhage_rules_boost//:config.lzma-osx.h",
":windows": "@com_github_nelhage_rules_boost//:config.lzma-windows.h",
}),
out = "src/liblzma/api/config.h", # minimize the number of exported include paths
)
cc_library(
name = "lzma",
srcs = [
"src/common/tuklib_cpucores.c",
"src/common/tuklib_physmem.c",
"src/liblzma/check/check.c",
"src/liblzma/check/crc32_fast.c",
"src/liblzma/check/crc32_table.c",
"src/liblzma/check/crc64_fast.c",
"src/liblzma/check/crc64_table.c",
"src/liblzma/check/sha256.c",
"src/liblzma/common/alone_decoder.c",
"src/liblzma/common/alone_encoder.c",
"src/liblzma/common/auto_decoder.c",
"src/liblzma/common/block_buffer_decoder.c",
"src/liblzma/common/block_buffer_encoder.c",
"src/liblzma/common/block_decoder.c",
"src/liblzma/common/block_encoder.c",
"src/liblzma/common/block_header_decoder.c",
"src/liblzma/common/block_header_encoder.c",
"src/liblzma/common/block_util.c",
"src/liblzma/common/common.c",
"src/liblzma/common/easy_buffer_encoder.c",
"src/liblzma/common/easy_decoder_memusage.c",
"src/liblzma/common/easy_encoder.c",
"src/liblzma/common/easy_encoder_memusage.c",
"src/liblzma/common/easy_preset.c",
"src/liblzma/common/filter_buffer_decoder.c",
"src/liblzma/common/filter_buffer_encoder.c",
"src/liblzma/common/filter_common.c",
"src/liblzma/common/filter_decoder.c",
"src/liblzma/common/filter_encoder.c",
"src/liblzma/common/filter_flags_decoder.c",
"src/liblzma/common/filter_flags_encoder.c",
"src/liblzma/common/hardware_cputhreads.c",
"src/liblzma/common/hardware_physmem.c",
"src/liblzma/common/index.c",
"src/liblzma/common/index_decoder.c",
"src/liblzma/common/index_encoder.c",
"src/liblzma/common/index_hash.c",
"src/liblzma/common/outqueue.c",
"src/liblzma/common/stream_buffer_decoder.c",
"src/liblzma/common/stream_buffer_encoder.c",
"src/liblzma/common/stream_decoder.c",
"src/liblzma/common/stream_encoder.c",
"src/liblzma/common/stream_encoder_mt.c",
"src/liblzma/common/stream_flags_common.c",
"src/liblzma/common/stream_flags_decoder.c",
"src/liblzma/common/stream_flags_encoder.c",
"src/liblzma/common/vli_decoder.c",
"src/liblzma/common/vli_encoder.c",
"src/liblzma/common/vli_size.c",
"src/liblzma/delta/delta_common.c",
"src/liblzma/delta/delta_decoder.c",
"src/liblzma/delta/delta_encoder.c",
"src/liblzma/lz/lz_decoder.c",
"src/liblzma/lz/lz_encoder.c",
"src/liblzma/lz/lz_encoder_mf.c",
"src/liblzma/lzma/fastpos_table.c",
"src/liblzma/lzma/lzma2_decoder.c",
"src/liblzma/lzma/lzma2_encoder.c",
"src/liblzma/lzma/lzma_decoder.c",
"src/liblzma/lzma/lzma_encoder.c",
"src/liblzma/lzma/lzma_encoder_optimum_fast.c",
"src/liblzma/lzma/lzma_encoder_optimum_normal.c",
"src/liblzma/lzma/lzma_encoder_presets.c",
"src/liblzma/rangecoder/price_table.c",
"src/liblzma/simple/arm.c",
"src/liblzma/simple/armthumb.c",
"src/liblzma/simple/ia64.c",
"src/liblzma/simple/powerpc.c",
"src/liblzma/simple/simple_coder.c",
"src/liblzma/simple/simple_decoder.c",
"src/liblzma/simple/simple_encoder.c",
"src/liblzma/simple/sparc.c",
"src/liblzma/simple/x86.c",
"src/liblzma/api/config.h",
] + glob(["src/**/*.h"]),
hdrs = [
"src/liblzma/api/lzma.h",
"src/liblzma/api/lzma/base.h",
"src/liblzma/api/lzma/bcj.h",
"src/liblzma/api/lzma/block.h",
"src/liblzma/api/lzma/check.h",
"src/liblzma/api/lzma/container.h",
"src/liblzma/api/lzma/delta.h",
"src/liblzma/api/lzma/filter.h",
"src/liblzma/api/lzma/hardware.h",
"src/liblzma/api/lzma/index.h",
"src/liblzma/api/lzma/index_hash.h",
"src/liblzma/api/lzma/lzma12.h",
"src/liblzma/api/lzma/stream_flags.h",
"src/liblzma/api/lzma/version.h",
"src/liblzma/api/lzma/vli.h",
],
copts = select({
":windows": [],
"//conditions:default": ["-std=c99"],
}) + [
"-I external/org_lzma_lzma/src/common",
"-I external/org_lzma_lzma/src/liblzma",
"-I external/org_lzma_lzma/src/liblzma/api",
"-I external/org_lzma_lzma/src/liblzma/common",
"-I external/org_lzma_lzma/src/liblzma/check",
"-I external/org_lzma_lzma/src/liblzma/delta",
"-I external/org_lzma_lzma/src/liblzma/lz",
"-I external/org_lzma_lzma/src/liblzma/lzma",
"-I external/org_lzma_lzma/src/liblzma/rangecoder",
"-I external/org_lzma_lzma/src/liblzma/simple",
],
defines = select({
":windows": ["LZMA_API_STATIC"],
"//conditions:default": [],
}),
includes = [
"src/liblzma/api",
],
linkopts = ["-lpthread"],
linkstatic = select({
":windows": True,
"//conditions:default": False,
}),
local_defines = [
"HAVE_CONFIG_H",
],
visibility = ["//visibility:public"],
)