meson formatting
This commit is contained in:
parent
39c65797de
commit
f1fd2a827a
92
meson.build
92
meson.build
|
@ -1,17 +1,17 @@
|
||||||
project('desksanity', 'c',
|
project('desksanity', 'c',
|
||||||
version : '1.1.99',
|
version: '1.1.99',
|
||||||
license : 'BSD 2 clause',
|
license: 'BSD 2 clause',
|
||||||
default_options: [ 'c_std=gnu99', 'warning_level=2' ],
|
default_options: [ 'c_std=gnu99', 'warning_level=2' ],
|
||||||
meson_version : '>= 0.40.0')
|
meson_version: '>= 0.40.0')
|
||||||
|
|
||||||
add_global_arguments('-DHAVE_CONFIG_H=1', language: 'c')
|
add_global_arguments('-DHAVE_CONFIG_H=1', language: 'c')
|
||||||
dir_prefix = get_option('prefix')
|
dir_prefix = get_option('prefix')
|
||||||
dir_bin = join_paths(dir_prefix, get_option('bindir'))
|
dir_bin = join_paths(dir_prefix, get_option('bindir'))
|
||||||
dir_sysconf = get_option('sysconfdir')
|
dir_sysconf = get_option('sysconfdir')
|
||||||
dir_data = join_paths(dir_prefix, get_option('datadir'))
|
dir_data = join_paths(dir_prefix, get_option('datadir'))
|
||||||
dir_include = join_paths(dir_prefix, get_option('includedir'))
|
dir_include = join_paths(dir_prefix, get_option('includedir'))
|
||||||
dir_include_e = join_paths(dir_include, meson.project_name())
|
dir_include_e = join_paths(dir_include, meson.project_name())
|
||||||
dir_lib = join_paths(dir_prefix, get_option('libdir'))
|
dir_lib = join_paths(dir_prefix, get_option('libdir'))
|
||||||
|
|
||||||
|
|
||||||
pkgconfig = import('pkgconfig')
|
pkgconfig = import('pkgconfig')
|
||||||
|
@ -20,36 +20,36 @@ cc = meson.get_compiler('c')
|
||||||
# disable for release builds
|
# disable for release builds
|
||||||
dev_cflags = []
|
dev_cflags = []
|
||||||
dev_cflags_try = [
|
dev_cflags_try = [
|
||||||
'-Wall',
|
'-Wall',
|
||||||
'-W',
|
'-W',
|
||||||
'-Wpointer-arith',
|
'-Wpointer-arith',
|
||||||
'-Wshadow',
|
'-Wshadow',
|
||||||
'-Wno-missing-field-initializers',
|
'-Wno-missing-field-initializers',
|
||||||
'-Wfloat-equal',
|
'-Wfloat-equal',
|
||||||
'-Wuninitialized',
|
'-Wuninitialized',
|
||||||
'-Wundef',
|
'-Wundef',
|
||||||
'-Wcast-align',
|
'-Wcast-align',
|
||||||
'-Wformat=2',
|
'-Wformat=2',
|
||||||
'-Wno-format-y2k',
|
'-Wno-format-y2k',
|
||||||
]
|
]
|
||||||
|
|
||||||
foreach cf: dev_cflags_try
|
foreach cf: dev_cflags_try
|
||||||
if cc.has_argument(cf) == true
|
if cc.has_argument(cf) == true
|
||||||
dev_cflags += cf
|
dev_cflags += cf
|
||||||
endif
|
endif
|
||||||
endforeach
|
endforeach
|
||||||
add_global_arguments(dev_cflags, language: 'c')
|
add_global_arguments(dev_cflags, language: 'c')
|
||||||
|
|
||||||
release = 'ver-0.22'
|
release = 'ver-0.22'
|
||||||
host_os = host_machine.system()
|
host_os = host_machine.system()
|
||||||
if host_os == 'linux'
|
if host_os == 'linux'
|
||||||
if cc.has_header_symbol('features.h', '__UCLIBC__')
|
if cc.has_header_symbol('features.h', '__UCLIBC__')
|
||||||
host_os = 'linux-uclibc'
|
host_os = 'linux-uclibc'
|
||||||
elif cc.has_header_symbol('features.h', '__dietlibc__')
|
elif cc.has_header_symbol('features.h', '__dietlibc__')
|
||||||
host_os = 'linux-dietlibc'
|
host_os = 'linux-dietlibc'
|
||||||
else
|
else
|
||||||
host_os = 'linux-gnu'
|
host_os = 'linux-gnu'
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
module_arch = '@0@-@1@-@2@'.format(host_os, host_machine.cpu_family(), release)
|
module_arch = '@0@-@1@-@2@'.format(host_os, host_machine.cpu_family(), release)
|
||||||
|
@ -70,38 +70,38 @@ config_h.set_quoted('BINDIR', dir_bin)
|
||||||
config_h.set_quoted('DATADIR', dir_data)
|
config_h.set_quoted('DATADIR', dir_data)
|
||||||
|
|
||||||
if cc.has_function('setenv') == true
|
if cc.has_function('setenv') == true
|
||||||
config_h.set('HAVE_SETENV', '1')
|
config_h.set('HAVE_SETENV', '1')
|
||||||
endif
|
endif
|
||||||
if cc.has_function('unsetenv') == true
|
if cc.has_function('unsetenv') == true
|
||||||
config_h.set('HAVE_UNSETENV', '1')
|
config_h.set('HAVE_UNSETENV', '1')
|
||||||
endif
|
endif
|
||||||
if cc.has_function('clearenv') == true
|
if cc.has_function('clearenv') == true
|
||||||
config_h.set('HAVE_CLEARENV', '1')
|
config_h.set('HAVE_CLEARENV', '1')
|
||||||
endif
|
endif
|
||||||
if cc.has_header('features.h') == true
|
if cc.has_header('features.h') == true
|
||||||
config_h.set('HAVE_FEATURES_H', '1')
|
config_h.set('HAVE_FEATURES_H', '1')
|
||||||
endif
|
endif
|
||||||
if cc.has_header('sys/ptrace.h') == true
|
if cc.has_header('sys/ptrace.h') == true
|
||||||
config_h.set('HAVE_SYS_PTRACE_H', '1')
|
config_h.set('HAVE_SYS_PTRACE_H', '1')
|
||||||
endif
|
endif
|
||||||
if cc.has_header('arpa/inet.h') == true
|
if cc.has_header('arpa/inet.h') == true
|
||||||
config_h.set('HAVE_ARPA_INET_H', '1')
|
config_h.set('HAVE_ARPA_INET_H', '1')
|
||||||
endif
|
endif
|
||||||
if cc.has_header('netinet/in.h') == true
|
if cc.has_header('netinet/in.h') == true
|
||||||
config_h.set('HAVE_NETINET_IN_H', '1')
|
config_h.set('HAVE_NETINET_IN_H', '1')
|
||||||
endif
|
endif
|
||||||
if cc.has_header('execinfo.h') == true
|
if cc.has_header('execinfo.h') == true
|
||||||
config_h.set('HAVE_EXECINFO_H', '1')
|
config_h.set('HAVE_EXECINFO_H', '1')
|
||||||
elif cc.has_function('backtrace_symbols_fd', dependencies: 'execinfo') == false
|
elif cc.has_function('backtrace_symbols_fd', dependencies: 'execinfo') == false
|
||||||
execinfo_dep = dependency('execinfo', required: false)
|
execinfo_dep = dependency('execinfo', required: false)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if cc.has_header('fnmatch.h') == false
|
if cc.has_header('fnmatch.h') == false
|
||||||
error('fnmatch.h not found')
|
error('fnmatch.h not found')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if cc.has_function('fnmatch') == false
|
if cc.has_function('fnmatch') == false
|
||||||
dep_fnmatch = dependency('fnmatch', required: true)
|
dep_fnmatch = dependency('fnmatch', required: true)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
add_global_arguments('-DPACKAGE_BIN_DIR="@0@"'.format(dir_bin), language: 'c')
|
add_global_arguments('-DPACKAGE_BIN_DIR="@0@"'.format(dir_bin), language: 'c')
|
||||||
|
@ -112,7 +112,7 @@ add_global_arguments('-DPACKAGE_SYSCONF_DIR="@0@"'.format(dir_sysconf), language
|
||||||
dep_efl_wl = dependency('efl-wl', required: false)
|
dep_efl_wl = dependency('efl-wl', required: false)
|
||||||
dep_e = dependency('enlightenment')
|
dep_e = dependency('enlightenment')
|
||||||
|
|
||||||
dir_module_e = join_paths([dep_e.get_pkgconfig_variable('modules'), 'desksanity'])
|
dir_module_e = join_paths([dep_e.get_pkgconfig_variable('modules'), 'desksanity'])
|
||||||
edje_cc = find_program('edje_cc')
|
edje_cc = find_program('edje_cc')
|
||||||
|
|
||||||
install_data(['e-module-desksanity.edj', 'module.desktop'],
|
install_data(['e-module-desksanity.edj', 'module.desktop'],
|
||||||
|
@ -150,9 +150,9 @@ if dep_efl_wl.found() == true
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
configure_file(output : 'config.h',
|
configure_file(output: 'config.h',
|
||||||
install : false,
|
install: false,
|
||||||
configuration: config_h)
|
configuration: config_h)
|
||||||
|
|
||||||
executable('e_gadget_test',
|
executable('e_gadget_test',
|
||||||
'loader/test.c',
|
'loader/test.c',
|
||||||
|
|
Loading…
Reference in New Issue