add LOCAL build option

This commit is contained in:
a-Sansara 2018-09-05 02:04:22 +02:00
parent 36f7cdcc6f
commit 3b915dcc92
5 changed files with 19 additions and 5 deletions

View File

@ -65,6 +65,11 @@ function build.lib()
cd "$DIR"
build.title "$lib LIB BUILD"
meson --prefix=/usr ./ build
if [ "$1" -eq 1 ]; then
meson configure -DLOCAL=true build
else
meson configure -DLOCAL=false build
fi
if [ "$UID" != "0" ]; then
sudo ninja -v install -C build
else
@ -112,10 +117,10 @@ function build.main()
if [ ! -z "$1" ]; then
onefile="./samples/$1.vala"
fi
build.lib
build.lib "$2"
if [ $? -eq 0 ]; then
build.samples $onefile
fi
}
build.main "$1"
build.main "$1" "${2:-0}"

View File

@ -38,10 +38,14 @@ incdir = join_paths(get_option('prefix'), get_option('includedir'), 'plui
conf = configuration_data()
conf.set('VERSION' , version)
conf.set('INSTALL_PATH', bindir)
conf.set('DATA_PATH' , datadir)
if get_option('LOCAL')
conf.set('DATA_PATH' , './resources')
else
conf.set('DATA_PATH' , datadir)
endif
configure_file(
input: 'src/install.vala',
input: 'src/vala/install.vala.in',
output: 'install.vala',
configuration: conf
)
@ -60,9 +64,12 @@ install_data('resources/config/subdir/test.yml', install_dir : join_paths(datadi
subdir('src')
add_global_arguments('-D DEBUG', language : 'valac')
libpluie_yaml = library(
'pluie-yaml-' + version,
src_files + [ 'build/install.vala' ],
src_files,
vala_header : 'pluie_yaml.h',
vala_vapi : 'pluie-yaml-' +version+'.vapi',
dependencies : [

1
meson_options.txt Normal file
View File

@ -0,0 +1 @@
option('LOCAL', type : 'boolean', value : false)

View File

@ -29,6 +29,7 @@
src_files = [
'src/c/yaml.c',
'build/install.vala',
'src/vala/Pluie/Io.Reader.vala',
'src/vala/Pluie/Io.InputChunkStream.vala',
'src/vala/Pluie/Io.StreamLineMark.vala',