2016-08-12 14:55:17 +00:00
|
|
|
libcheck_files = [
|
|
|
|
'check.c',
|
|
|
|
'check_error.c',
|
|
|
|
'check_list.c',
|
|
|
|
'check_log.c',
|
|
|
|
'check_msg.c',
|
|
|
|
'check_pack.c',
|
|
|
|
'check_print.c',
|
|
|
|
'check_run.c',
|
|
|
|
'check_str.c',
|
2016-12-09 09:48:11 +00:00
|
|
|
'libcompat/libcompat.c'
|
2016-08-12 14:55:17 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
if not cdata.has('HAVE_ALARM')
|
2016-12-09 09:48:11 +00:00
|
|
|
libcheck_files += ['libcompat/alarm.c']
|
2016-08-12 14:55:17 +00:00
|
|
|
endif
|
|
|
|
|
2016-12-09 09:48:11 +00:00
|
|
|
if not cdata.has('HAVE_GETTIMEOFDAY')
|
|
|
|
libcheck_files += ['libcompat/gettimeofday.c']
|
|
|
|
endif
|
|
|
|
|
2016-08-12 14:55:17 +00:00
|
|
|
if not cdata.has('HAVE_CLOCK_GETTIME')
|
2016-12-09 09:48:11 +00:00
|
|
|
libcheck_files += ['libcompat/clock_gettime.c']
|
2016-08-12 14:55:17 +00:00
|
|
|
endif
|
|
|
|
|
2016-12-09 09:48:11 +00:00
|
|
|
if not cdata.has('HAVE_DECL_LOCALTIME_R')
|
|
|
|
libcheck_files += ['libcompat/localtime_r.c']
|
|
|
|
endif
|
|
|
|
|
2016-08-12 14:55:17 +00:00
|
|
|
if not cdata.has('HAVE_DECL_STRSIGNAL')
|
2016-12-09 09:48:11 +00:00
|
|
|
libcheck_files += ['libcompat/strsignal.c']
|
2016-08-12 14:55:17 +00:00
|
|
|
endif
|
|
|
|
|
2016-12-09 09:48:11 +00:00
|
|
|
if not cdata.has('HAVE_DECL_STRDUP') and not cdata.has('HAVE__STRDUP')
|
|
|
|
libcheck_files += ['libcompat/strdup.c']
|
|
|
|
endif
|
|
|
|
|
|
|
|
if not cdata.has('HAVE_GETLINE')
|
|
|
|
libcheck_files += ['libcompat/getline.c']
|
|
|
|
endif
|
|
|
|
|
|
|
|
# FIXME: check that timer_create, timer_settime, timer_delete are in rt_lib
|
2016-08-12 14:55:17 +00:00
|
|
|
if not rt_lib.found()
|
2016-12-09 09:48:11 +00:00
|
|
|
libcheck_files += [
|
|
|
|
'libcompat/timer_create.c',
|
|
|
|
'libcompat/timer_settime.c',
|
|
|
|
'libcompat/timer_delete.c'
|
|
|
|
]
|
2016-08-12 14:55:17 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
configure_file(input : 'check.h.in',
|
|
|
|
output : 'check.h',
|
|
|
|
configuration : check_cdata)
|
|
|
|
|
|
|
|
internal_check_h_inc = include_directories('..')
|
|
|
|
|
2017-08-10 12:32:43 +00:00
|
|
|
# Must explicitly make symbols public if default visibility is hidden
|
|
|
|
if have_visibility_hidden
|
|
|
|
libcheck_visibility_args = ['-DCK_DLL_EXP=extern __attribute__ ((visibility ("default")))']
|
|
|
|
else
|
2017-11-08 19:05:03 +00:00
|
|
|
if host_system == 'windows'
|
|
|
|
libcheck_visibility_args = ['-DCK_DLL_EXP=__declspec(dllexport)']
|
|
|
|
else
|
|
|
|
libcheck_visibility_args = ['-DCK_DLL_EXP=extern']
|
|
|
|
endif
|
2017-08-10 12:32:43 +00:00
|
|
|
endif
|
|
|
|
|
2018-03-01 16:20:06 +00:00
|
|
|
no_warn_args = []
|
|
|
|
foreach arg : [
|
|
|
|
'-Wno-undef',
|
|
|
|
'-Wno-redundant-decls',
|
|
|
|
'-Wno-missing-prototypes',
|
|
|
|
'-Wno-missing-declarations',
|
|
|
|
'-Wno-old-style-definition',
|
|
|
|
'-Wno-declaration-after-statement']
|
|
|
|
if cc.has_argument(arg)
|
|
|
|
no_warn_args += [arg]
|
|
|
|
endif
|
|
|
|
endforeach
|
|
|
|
|
2016-08-12 14:55:17 +00:00
|
|
|
libcheck = static_library('check',
|
|
|
|
libcheck_files,
|
2016-12-09 09:48:11 +00:00
|
|
|
include_directories : [configinc, internal_check_h_inc],
|
2016-08-12 14:55:17 +00:00
|
|
|
dependencies : [rt_lib, mathlib],
|
2018-03-01 16:20:06 +00:00
|
|
|
c_args: gst_c_args + libcheck_visibility_args + no_warn_args +
|
2016-12-09 09:48:11 +00:00
|
|
|
# Don't want libcompat to think we don't have these and substitute
|
2016-12-09 12:29:53 +00:00
|
|
|
# replacements since we don't check for or define these. See libcompat.h
|
|
|
|
['-DHAVE_VSNPRINTF', '-DHAVE_SNPRINTF', '-DHAVE_MALLOC', '-DHAVE_REALLOC'],
|
2016-10-20 18:38:46 +00:00
|
|
|
pic: true)
|