2
0

Package.swift 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. // swift-tools-version:5.0
  2. // The swift-tools-version declares the minimum version of Swift required to build this package.
  3. import PackageDescription
  4. let package = Package(
  5. name: "nanopb",
  6. products: [
  7. .library(
  8. name: "nanopb",
  9. targets: ["nanopb"]
  10. )
  11. ],
  12. targets: [
  13. .target(
  14. name: "nanopb",
  15. path: ".",
  16. sources: [
  17. "pb.h",
  18. "pb_common.h",
  19. "pb_common.c",
  20. "pb_decode.h",
  21. "pb_decode.c",
  22. "pb_encode.h",
  23. "pb_encode.c"
  24. ],
  25. publicHeadersPath: "spm_headers",
  26. cSettings: [
  27. .define("PB_FIELD_32BIT", to: "1"),
  28. .define("PB_NO_PACKED_STRUCTS", to: "1"),
  29. .define("PB_ENABLE_MALLOC", to: "1"),
  30. ]
  31. ),
  32. .testTarget(
  33. name: "swift-test",
  34. dependencies: [
  35. "nanopb",
  36. ],
  37. path: "spm-test/swift",
  38. cSettings: [
  39. .headerSearchPath("../"),
  40. .define("PB_FIELD_32BIT", to: "1"),
  41. .define("PB_NO_PACKED_STRUCTS", to: "1"),
  42. .define("PB_ENABLE_MALLOC", to: "1"),
  43. ]
  44. ),
  45. .testTarget(
  46. name: "objc-test",
  47. dependencies: [
  48. "nanopb",
  49. ],
  50. path: "spm-test/objc",
  51. cSettings: [
  52. .headerSearchPath("../"),
  53. .define("PB_FIELD_32BIT", to: "1"),
  54. .define("PB_NO_PACKED_STRUCTS", to: "1"),
  55. .define("PB_ENABLE_MALLOC", to: "1"),
  56. ]
  57. )
  58. ]
  59. )