You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

63 lines
1.6 KiB

11 months ago
  1. ceedling-subprojects
  2. ====================
  3. Plugin for supporting subprojects that are built as static libraries. It continues to support
  4. dependency tracking, without getting confused between your main project files and your
  5. subproject files. It accepts different compiler flags and linker flags, allowing you to
  6. optimize for your situation.
  7. First, you're going to want to add the extension to your list of known extensions:
  8. ```
  9. :extension:
  10. :subprojects: '.a'
  11. ```
  12. Define a new section called :subprojects. There, you can list as many subprojects
  13. as you may need under the :paths key. For each, you specify a unique place to build
  14. and a unique name.
  15. ```
  16. :subprojects:
  17. :paths:
  18. - :name: libprojectA
  19. :source:
  20. - ./subprojectA/first/dir
  21. - ./subprojectA/second/dir
  22. :include:
  23. - ./subprojectA/include/dir
  24. :build_root: ./subprojectA/build/dir
  25. :defines:
  26. - DEFINE_JUST_FOR_THIS_FILE
  27. - AND_ANOTHER
  28. - :name: libprojectB
  29. :source:
  30. - ./subprojectB/only/dir
  31. :include:
  32. - ./subprojectB/first/include/dir
  33. - ./subprojectB/second/include/dir
  34. :build_root: ./subprojectB/build/dir
  35. :defines: [] #none for this one
  36. ```
  37. You can specify the compiler and linker, just as you would a release build:
  38. ```
  39. :tools:
  40. :subprojects_compiler:
  41. :executable: gcc
  42. :arguments:
  43. - -g
  44. - -I"$": COLLECTION_PATHS_SUBPROJECTS
  45. - -D$: COLLECTION_DEFINES_SUBPROJECTS
  46. - -c "${1}"
  47. - -o "${2}"
  48. :subprojects_linker:
  49. :executable: ar
  50. :arguments:
  51. - rcs
  52. - ${2}
  53. - ${1}
  54. ```
  55. That's all there is to it! Happy Hacking!