2021-07-31 19:05:04 +02:00
|
|
|
project('ksr', 'c', version : '0.1', default_options : ['warning_level=3'])
|
|
|
|
c = meson.get_compiler('c')
|
|
|
|
|
|
|
|
# declare the dependencies of the library.
|
|
|
|
deps = [ dependency('jemalloc') ]
|
|
|
|
# add pthread dependency
|
|
|
|
deps += c.find_library('pthread')
|
|
|
|
|
|
|
|
# includes
|
2021-08-01 00:10:00 +02:00
|
|
|
include_dirs = include_directories([ 'include' ])
|
2021-07-31 19:05:04 +02:00
|
|
|
|
|
|
|
# source files.
|
|
|
|
libsrc = [
|
|
|
|
'src/arrays.c',
|
|
|
|
'src/buffers.c',
|
|
|
|
'src/promises.c',
|
|
|
|
'src/regex.c',
|
|
|
|
'src/files.c',
|
|
|
|
'src/string.c',
|
|
|
|
]
|
|
|
|
|
|
|
|
# library target.
|
|
|
|
libksr = library('ksr', libsrc, dependencies : deps, include_directories : include_dirs, install : true)
|
2021-08-10 00:12:53 +02:00
|
|
|
# initialize library dependency.
|
|
|
|
libksr_dep = declare_dependency(link_with : libksr, include_directories : 'include')
|
2021-07-31 19:05:04 +02:00
|
|
|
|
|
|
|
# add the library to the dependencies of the executables.
|
2021-08-10 00:12:53 +02:00
|
|
|
deps += libksr_dep
|
2021-07-31 19:05:04 +02:00
|
|
|
|
|
|
|
# test executables.
|
|
|
|
test_ksrarrays = executable('test_ksrarrays', [ 'tests/ksrarrays.c' ], dependencies : deps, include_directories : include_dirs, install : false)
|
|
|
|
test_ksrbuffers = executable('test_ksrbuffers', [ 'tests/ksrbuffers.c' ], dependencies : deps, include_directories : include_dirs, install : false)
|
|
|
|
test_ksrpromises = executable('test_ksrpromises', [ 'tests/ksrpromises.c' ], dependencies : deps, include_directories : include_dirs, install : false)
|
|
|
|
test_ksregex = executable('test_ksregex', [ 'tests/ksregex.c' ], dependencies : deps, include_directories : include_dirs, install : false)
|
|
|
|
test_ksrstring = executable('test_ksrstring', [ 'tests/ksrstring.c' ], dependencies : deps, include_directories : include_dirs, install : false)
|
|
|
|
test_ksrfiles = executable('test_ksrfiles', [ 'tests/ksrfiles.c' ], dependencies : deps, include_directories : include_dirs, install : false)
|
2023-02-12 16:31:42 +01:00
|
|
|
test_ksrlogging = executable('test_ksrlogging', [ 'tests/ksrlogging.c' ], dependencies : deps, include_directories : include_dirs, install : false)
|
2021-07-31 19:05:04 +02:00
|
|
|
|
|
|
|
# tests.
|
|
|
|
test('ksrarrays', test_ksrarrays)
|
|
|
|
test('ksrbuffers', test_ksrbuffers)
|
|
|
|
test('ksrpromises', test_ksrpromises)
|
|
|
|
test('ksregex', test_ksregex)
|
|
|
|
test('ksrfiles', test_ksrfiles)
|
|
|
|
test('ksrstring', test_ksrstring)
|
2023-02-12 16:31:42 +01:00
|
|
|
test('ksrlogging', test_ksrlogging)
|