__init__.py 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. from devtools.yamaker.fileutil import files
  2. from devtools.yamaker.modules import Linkable, Switch, Words
  3. from devtools.yamaker.project import CMakeNinjaNixProject
  4. def post_install(self):
  5. m = self.yamakes["."]
  6. # Support Darwin.
  7. linux_srcs = files(self.srcdir + "/source/unix/", rel=self.srcdir)
  8. darwin_srcs = files(self.srcdir + "/source/darwin/", rel=self.srcdir)
  9. windows_srcs = files(self.srcdir + "/source/windows/", rel=self.srcdir)
  10. m.SRCS -= set(linux_srcs)
  11. m.after(
  12. "SRCS",
  13. Switch(
  14. OS_LINUX=Linkable(SRCS=linux_srcs),
  15. OS_DARWIN=Linkable(
  16. SRCS=darwin_srcs,
  17. LDFLAGS=[Words("-framework", "Security")],
  18. ),
  19. OS_WINDOWS=Linkable(SRCS=windows_srcs),
  20. ),
  21. )
  22. m.after(
  23. "CFLAGS",
  24. Switch(
  25. OS_WINDOWS=Linkable(
  26. CFLAGS=["-DAWS_CAL_EXPORTS"],
  27. ),
  28. ),
  29. )
  30. aws_c_cal = CMakeNinjaNixProject(
  31. arcdir="contrib/restricted/aws/aws-c-cal",
  32. nixattr="aws-c-cal",
  33. copy_sources=[
  34. "source/darwin/",
  35. "source/windows/",
  36. ],
  37. ignore_targets=["sha256_profile"],
  38. post_install=post_install,
  39. )