BUILD.lzma-sys.bazel 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. # Copyright Materialize, Inc. and contributors. All rights reserved.
  2. #
  3. # Licensed under the Apache License, Version 2.0 (the "License");
  4. # you may not use this file except in compliance with the License.
  5. # You may obtain a copy of the License in the LICENSE file at the
  6. # root of this repository, or online at
  7. #
  8. # http://www.apache.org/licenses/LICENSE-2.0
  9. #
  10. # Unless required by applicable law or agreed to in writing, software
  11. # distributed under the License is distributed on an "AS IS" BASIS,
  12. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. # See the License for the specific language governing permissions and
  14. # limitations under the License.
  15. """Builds xz from the lzma-sys crate."""
  16. cc_library(
  17. name = "xz",
  18. srcs = glob(
  19. include = [
  20. "xz-5.2/src/liblzma/api/**/*.c",
  21. "xz-5.2/src/liblzma/lzma/**/*.c",
  22. "xz-5.2/src/liblzma/lzma/**/*.h",
  23. "xz-5.2/src/liblzma/lz/**/*.c",
  24. "xz-5.2/src/liblzma/lz/**/*.h",
  25. "xz-5.2/src/liblzma/check/**/*.c",
  26. "xz-5.2/src/liblzma/check/**/*.h",
  27. "xz-5.2/src/liblzma/simple/**/*.c",
  28. "xz-5.2/src/liblzma/simple/**/*.h",
  29. "xz-5.2/src/liblzma/delta/**/*.c",
  30. "xz-5.2/src/liblzma/delta/**/*.h",
  31. "xz-5.2/src/liblzma/common/**/*.c",
  32. "xz-5.2/src/liblzma/common/**/*.h",
  33. "xz-5.2/src/liblzma/rangecoder/**/*.c",
  34. "xz-5.2/src/liblzma/rangecoder/**/*.h",
  35. "xz-5.2/src/common/**/*.h",
  36. ],
  37. exclude = [
  38. "**/*crc32_small*",
  39. "**/*crc64_small*",
  40. "**/*tablegen*",
  41. ],
  42. ) + [
  43. "config.h",
  44. "xz-5.2/src/common/tuklib_cpucores.c",
  45. "xz-5.2/src/common/tuklib_physmem.c",
  46. ],
  47. hdrs = glob(["xz-5.2/src/liblzma/api/**/*.h"]),
  48. copts = [
  49. "-std=c99",
  50. "-pthread",
  51. ],
  52. includes = [
  53. "xz-5.2/src/common",
  54. "xz-5.2/src/liblzma/api",
  55. "xz-5.2/src/liblzma/check",
  56. "xz-5.2/src/liblzma/common",
  57. "xz-5.2/src/liblzma/delta",
  58. "xz-5.2/src/liblzma/lz",
  59. "xz-5.2/src/liblzma/lzma",
  60. "xz-5.2/src/liblzma/rangecoder",
  61. "xz-5.2/src/liblzma/simple",
  62. # The current working directory.
  63. "",
  64. ],
  65. local_defines = ["HAVE_CONFIG_H=1"],
  66. )