| 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 |
|
| 22 |
|
| 23 |
set(SOURCES libcompat.c) |
| 24 |
|
| 25 |
set(SOURCES ${SOURCES} fpclassify.c) |
| 26 |
|
| 27 |
if (NOT HAVE_LIBRT) |
| 28 |
set(SOURCES ${SOURCES} clock_gettime.c) |
| 29 |
set(SOURCES ${SOURCES} timer_create.c) |
| 30 |
set(SOURCES ${SOURCES} timer_delete.c) |
| 31 |
set(SOURCES ${SOURCES} timer_settime.c) |
| 32 |
endif(NOT HAVE_LIBRT) |
| 33 |
|
| 34 |
if(NOT HAVE_GETLINE) |
| 35 |
set(SOURCES ${SOURCES} getline.c) |
| 36 |
endif(NOT HAVE_GETLINE) |
| 37 |
|
| 38 |
if(NOT HAVE_GETTIMEOFDAY) |
| 39 |
set(SOURCES ${SOURCES} gettimeofday.c) |
| 40 |
endif(NOT HAVE_GETTIMEOFDAY) |
| 41 |
|
| 42 |
if(NOT HAVE_DECL_LOCALTIME_R) |
| 43 |
set(SOURCES ${SOURCES} localtime_r.c) |
| 44 |
endif(NOT HAVE_DECL_LOCALTIME_R) |
| 45 |
|
| 46 |
if(NOT HAVE_MALLOC) |
| 47 |
set(SOURCES ${SOURCES} malloc.c) |
| 48 |
endif(NOT HAVE_MALLOC) |
| 49 |
|
| 50 |
if(NOT HAVE_REALLOC) |
| 51 |
set(SOURCES ${SOURCES} realloc.c) |
| 52 |
endif(NOT HAVE_REALLOC) |
| 53 |
|
| 54 |
if(NOT HAVE_SNPRINTF) |
| 55 |
set(SOURCES ${SOURCES} snprintf.c) |
| 56 |
endif(NOT HAVE_SNPRINTF) |
| 57 |
|
| 58 |
if(NOT HAVE_DECL_STRDUP AND NOT HAVE__STRDUP) |
| 59 |
set(SOURCES ${SOURCES} strdup.c) |
| 60 |
endif(NOT HAVE_DECL_STRDUP AND NOT HAVE__STRDUP) |
| 61 |
|
| 62 |
if(NOT HAVE_DECL_STRSIGNAL) |
| 63 |
set(SOURCES ${SOURCES} strsignal.c) |
| 64 |
endif(NOT HAVE_DECL_STRSIGNAL) |
| 65 |
|
| 66 |
if(NOT HAVE_DECL_ALARM) |
| 67 |
set(SOURCES ${SOURCES} alarm.c) |
| 68 |
endif(NOT HAVE_DECL_ALARM) |
| 69 |
|
| 70 |
if (NOT HAVE_PTHREAD) |
| 71 |
set(SOURCES ${SOURCES} pthread_mutex.c) |
| 72 |
endif() |
| 73 |
|
| 74 |
set(HEADERS libcompat.h) |
| 75 |
|
| 76 |
add_library(compat STATIC ${SOURCES} ${HEADERS}) |
| 77 |
|
| 78 |
# vim: shiftwidth=2:softtabstop=2:tabstop=2:expandtab:autoindent |
| 79 |
|