CMakeLists.txt 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. #
  2. # Check: a unit test framework for C
  3. # Copyright (C) 2011 Mateusz Loskot
  4. # Copyright (C) 2020 Mikko Koivunalho
  5. #
  6. # This library is free software; you can redistribute it and/or
  7. # modify it under the terms of the GNU Lesser General Public
  8. # License as published by the Free Software Foundation; either
  9. # version 2.1 of the License, or (at your option) any later version.
  10. #
  11. # This library is distributed in the hope that it will be useful,
  12. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. # Lesser General Public License for more details.
  15. #
  16. # You should have received a copy of the GNU Lesser General Public
  17. # License along with this library; if not, write to the
  18. # Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  19. # Boston, MA 02111-1307, USA.
  20. #
  21. set(SOURCES libcompat.c)
  22. set(SOURCES ${SOURCES} fpclassify.c)
  23. if (NOT HAVE_LIBRT)
  24. set(SOURCES ${SOURCES} clock_gettime.c)
  25. set(SOURCES ${SOURCES} timer_create.c)
  26. set(SOURCES ${SOURCES} timer_delete.c)
  27. set(SOURCES ${SOURCES} timer_settime.c)
  28. endif(NOT HAVE_LIBRT)
  29. if(NOT HAVE_GETLINE)
  30. set(SOURCES ${SOURCES} getline.c)
  31. endif(NOT HAVE_GETLINE)
  32. if(NOT HAVE_GETTIMEOFDAY)
  33. set(SOURCES ${SOURCES} gettimeofday.c)
  34. endif(NOT HAVE_GETTIMEOFDAY)
  35. if(NOT HAVE_DECL_LOCALTIME_R)
  36. set(SOURCES ${SOURCES} localtime_r.c)
  37. endif(NOT HAVE_DECL_LOCALTIME_R)
  38. if(NOT HAVE_MALLOC)
  39. set(SOURCES ${SOURCES} malloc.c)
  40. endif(NOT HAVE_MALLOC)
  41. if(NOT HAVE_REALLOC)
  42. set(SOURCES ${SOURCES} realloc.c)
  43. endif(NOT HAVE_REALLOC)
  44. if(NOT HAVE_SNPRINTF)
  45. set(SOURCES ${SOURCES} snprintf.c)
  46. endif(NOT HAVE_SNPRINTF)
  47. if(NOT HAVE_DECL_STRDUP AND NOT HAVE__STRDUP)
  48. set(SOURCES ${SOURCES} strdup.c)
  49. endif(NOT HAVE_DECL_STRDUP AND NOT HAVE__STRDUP)
  50. if(NOT HAVE_DECL_STRSIGNAL)
  51. set(SOURCES ${SOURCES} strsignal.c)
  52. endif(NOT HAVE_DECL_STRSIGNAL)
  53. if(NOT HAVE_DECL_ALARM)
  54. set(SOURCES ${SOURCES} alarm.c)
  55. endif(NOT HAVE_DECL_ALARM)
  56. if (NOT HAVE_PTHREAD)
  57. set(SOURCES ${SOURCES} pthread_mutex.c)
  58. endif()
  59. set(HEADERS libcompat.h)
  60. add_library(compat STATIC ${SOURCES} ${HEADERS})
  61. # vim: shiftwidth=2:softtabstop=2:tabstop=2:expandtab:autoindent