simplified meson.build (#206)

This commit is contained in:
Robert Gonzalez 2023-06-29 23:20:27 -07:00 committed by GitHub
parent 60c37844d7
commit fd02ea0c56
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3,7 +3,7 @@ project('parson', 'c',
license : 'MIT', license : 'MIT',
meson_version : '>=0.46.0', meson_version : '>=0.46.0',
default_options : [ default_options : [
'c_std=c89', 'optimization=2', 'c_std=c89', 'optimization=2',
'warning_level=2' 'warning_level=2'
] ]
) )
@ -12,39 +12,25 @@ parson_sources = ['parson.c']
parson_inc = include_directories('.') parson_inc = include_directories('.')
lib_so_version = '0' parson_lib = library(
parson_shared_lib = shared_library(
meson.project_name(),
sources: parson_sources,
soversion: lib_so_version,
install: true
)
parson_static_lib = static_library(
meson.project_name(), meson.project_name(),
sources: parson_sources, sources: parson_sources,
install: true install: true
) )
install_headers('parson.h', subdir : 'parson') install_headers('parson.h')
parson_shared_dep = declare_dependency( parson = declare_dependency(
include_directories : parson_inc, include_directories : parson_inc,
link_with : parson_shared_lib link_with : parson_lib
)
parson_static_dep = declare_dependency(
include_directories : parson_inc,
link_with : parson_static_lib
) )
pkgconfig = import('pkgconfig') pkgconfig = import('pkgconfig')
# will create a pkg config for the shared lib only # will create a pkg config
pkgconfig.generate(parson_shared_lib, pkgconfig.generate(parson_lib,
version: meson.project_version(), version: meson.project_version(),
filebase: meson.project_name(), filebase: meson.project_name(),
name: meson.project_name(), name: meson.project_name(),
description: 'Lightweight JSON library written in C.', description: 'Lightweight JSON library written in C.',
) )