diff options
-rw-r--r-- | include/rin/compat.h | 1 | ||||
-rw-r--r-- | meson.build | 18 | ||||
-rw-r--r-- | meson_options.txt | 16 |
3 files changed, 11 insertions, 24 deletions
diff --git a/include/rin/compat.h b/include/rin/compat.h index 4ea777d..03bed37 100644 --- a/include/rin/compat.h +++ b/include/rin/compat.h @@ -29,7 +29,6 @@ # if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 29) # include <sys/types.h> # else -# define _GNU_SOURCE # include <sys/syscall.h> # define gettid() (syscall(SYS_gettid)) # endif diff --git a/meson.build b/meson.build index 8662782..91f07fc 100644 --- a/meson.build +++ b/meson.build @@ -1,29 +1,21 @@ project('librin', 'c', license : 'LGPL2.1', version : '0.0.4', - default_options : ['c_std=gnu89', 'buildtype=release']) + default_options : ['c_std=c11', 'buildtype=release']) inc = include_directories('include') pkg = import('pkgconfig') +add_project_arguments('-D_GNU_SOURCE', language : 'c') + subdir('include') subdir('src') -if ((not get_option('static')) and (not get_option('shared'))) - librin = library('rin', sources, version : meson.project_version(), include_directories : inc, install : true) -endif - -if get_option('static') - librin = static_library('rin', sources, version : meson.project_version(), include_directories : inc, install : true) -endif - -if get_option('shared') - librin = shared_library('rin', sources, version : meson.project_version(), include_directories : inc, install : true) -endif +librin = library('rin', sources, version : meson.project_version(), include_directories : inc, pic : get_option('enable-pic'), install : true) pkg.generate(librin) -if get_option('tests') +if get_option('enable-tests') subdir('test') endif diff --git a/meson_options.txt b/meson_options.txt index 0e1aca4..b4ed44d 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -1,12 +1,8 @@ -option('static', +option('enable-pic', + type : 'feature', + value : 'enabled', + description : 'Switch whether to generate position-independent code') +option('enable-tests', type : 'boolean', value : false, - description : 'Enable building a static library') -option('shared', - type : 'boolean', - value : false, - description : 'Enable building a dynamic library') -option('tests', - type : 'boolean', - value : false, - description : 'Enable building and running tests') + description : 'Switch for building and running tests') |