1
1
project (' json-c' , ' c' ,
2
- version : ' 0.16 ' ,
2
+ version : ' 0.17 ' ,
3
3
license : ' MIT' ,
4
4
meson_version : ' >=0.49' ,
5
5
default_options : [' c_std=gnu99' ],
@@ -8,17 +8,16 @@ project('json-c', 'c',
8
8
cc = meson .get_compiler(' c' )
9
9
10
10
if cc.get_argument_syntax() == ' msvc'
11
- add_project_arguments (' -D_CRT_SECURE_NO_WARNINGS' , cc.get_supported_arguments(' -Wno-deprecated-declarations' ), language : ' c' )
11
+ add_project_arguments (' -D_CRT_SECURE_NO_WARNINGS' , ' -DWIN32=_WIN32' , language : ' c' )
12
+ else
13
+ add_project_arguments (' -D_GNU_SOURCE' , language : ' c' )
12
14
endif
13
15
14
16
if get_option (' default_library' ) != ' static'
15
17
add_project_arguments (' -DJSON_C_DLL' , language : ' c' )
16
18
endif
17
19
18
- add_project_arguments (' -D_GNU_SOURCE' , language : ' c' )
19
- if cc.has_argument(' -Wno-unused' )
20
- add_project_arguments (' -Wno-unused' , language : ' c' )
21
- endif
20
+ add_project_arguments (cc.get_supported_arguments(' -Wno-deprecated-declarations' ), language : ' c' )
22
21
23
22
threads = dependency (' threads' , required : false )
24
23
math = cc.find_library (' m' , required : false )
@@ -28,7 +27,7 @@ inc = include_directories('config')
28
27
29
28
json_config = configuration_data ()
30
29
if conf.has(' HAVE_INTTYPES_H' )
31
- json_config.set10 (' JSON_C_HAVE_INTTYPES_H' , true )
30
+ json_config.set (' JSON_C_HAVE_INTTYPES_H' , 1 )
32
31
endif
33
32
json_config_h = configure_file (
34
33
configuration : json_config,
@@ -37,6 +36,7 @@ json_config_h = configure_file(
37
36
38
37
jconf = configuration_data ()
39
38
jconf.set(' JSON_H_JSON_POINTER' , ' #include "json_pointer.h"' )
39
+ jconf.set(' JSON_H_JSON_PATCH' , ' #include "json_patch.h"' )
40
40
41
41
json_h = configure_file (
42
42
input : ' json.h.cmakein' ,
@@ -60,7 +60,7 @@ public_headers = [
60
60
' printbuf.h' ,
61
61
]
62
62
63
- sources = [
63
+ sources = files (
64
64
' arraylist.c' ,
65
65
' debug.c' ,
66
66
' json_c_version.c' ,
@@ -74,9 +74,11 @@ sources = [
74
74
' printbuf.c' ,
75
75
' random_seed.c' ,
76
76
' strerror_override.c' ,
77
- ]
77
+ )
78
78
79
- libjson_c = library (meson .project_name(), json_config_h, json_h, config_h, sources,
79
+ libjson_c = library (
80
+ ' json-c' ,
81
+ sources,
80
82
include_directories : inc,
81
83
install : true ,
82
84
)
@@ -88,14 +90,13 @@ json_c_dep = declare_dependency(
88
90
sources : json_config_h,
89
91
)
90
92
91
- header_subdir = ' json-c'
92
- install_headers (public_headers, subdir : header_subdir)
93
+ install_headers (public_headers, subdir : ' json-c' )
93
94
94
95
pkgconfig = import (' pkgconfig' )
95
96
pkgconfig.generate(libjson_c,
96
97
description : ' A JSON implementation in C' ,
97
98
version : meson .project_version(),
98
99
filebase : meson .project_name(),
99
100
name : meson .project_name(),
100
- subdirs : header_subdir ,
101
+ subdirs : ' json-c ' ,
101
102
)
0 commit comments