Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
cJSON
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
OpenVMS
libraries
cJSON
Commits
4488fd5a5b82
Commit
4488fd5a5b82
authored
8 years ago
by
Max Bruckner
Browse files
Options
Downloads
Patches
Plain Diff
Initial support for the Meson build system
parent
35aaf3546d52
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
meson.build
+58
-0
58 additions, 0 deletions
meson.build
meson_options.txt
+2
-0
2 additions, 0 deletions
meson_options.txt
tests/meson.build
+58
-0
58 additions, 0 deletions
tests/meson.build
with
118 additions
and
0 deletions
meson.build
0 → 100644
+
58
−
0
View file @
4488fd5a
project
(
'cJSON'
,
'c'
,
default_options
:
[
'c_std=c89'
])
version
=
'1.6.0'
soversion
=
'0'
compiler
=
meson
.
get_compiler
(
'c'
)
compiler_flags
=
[]
if
(
compiler
.
get_id
()
==
'clang'
)
or
(
compiler
.
get_id
()
==
'gcc'
)
compiler_flags
+=
[
'-pedantic'
,
'-Wall'
,
'-Wextra'
,
'-Werror'
,
'-Wstrict-prototypes'
,
'-Wwrite-strings'
,
'-Wshadow'
,
'-Winit-self'
,
'-Wcast-align'
,
'-Wformat=2'
,
'-Wmissing-prototypes'
,
'-Wstrict-overflow=2'
,
'-Wcast-qual'
,
'-Wundef'
,
'-Wswitch-default'
,
'-Wconversion'
,
'-Wc++-compat'
,
'-fstack-protector-strong'
,
'-Wcomma'
,
'-Wdouble-promotion'
,
'-Wparentheses'
,
'-Wformat-overflow'
,
'-Wunused-macros'
,
'-Wmissing-variable-declarations'
,
'-Wused-but-marked-unused'
,
'-Wswitch-enum'
]
endif
foreach
flag
:
compiler_flags
if
compiler
.
has_argument
(
flag
)
add_project_arguments
(
flag
,
language
:
'c'
)
endif
endforeach
math
=
compiler
.
find_library
(
'm'
,
required
:
false
)
cjson
=
shared_library
(
'cjson'
,
'cJSON.c'
,
dependencies
:
math
,
version
:
version
,
soversion
:
soversion
,
install
:
true
)
if
get_option
(
'enable_cjson_utils'
)
cjson_utils
=
shared_library
(
'cjson_utils'
,
'cJSON_Utils.c'
,
link_with
:
cjson
,
version
:
version
,
soversion
:
soversion
,
install
:
true
)
endif
if
get_option
(
'enable_cjson_tests'
)
cjson_test
=
executable
(
'cjson_test'
,
'test.c'
,
link_with
:
cjson
)
test
(
'cjson_test'
,
cjson_test
)
endif
subdir
(
'tests'
)
This diff is collapsed.
Click to expand it.
meson_options.txt
0 → 100644
+
2
−
0
View file @
4488fd5a
option
(
'enable_cjson_utils'
,
type
:
'boolean'
,
value
:
true
)
option
(
'enable_cjson_tests'
,
type
:
'boolean'
,
value
:
true
)
This diff is collapsed.
Click to expand it.
tests/meson.build
0 → 100644
+
58
−
0
View file @
4488fd5a
if
get_option
(
'enable_cjson_tests'
)
unity_flags
=
[]
if
(
compiler
.
get_id
()
==
'clang'
)
or
(
compiler
.
get_id
()
==
'gcc'
)
unity_flags
+=
[
'-Wno-switch-enum'
,
'-Wno-error'
,
'-fvisibility=default'
,
'-fno-sanitize=float-divide-by-zero'
]
endif
unity_c_args
=
[]
foreach
flag
:
unity_flags
if
compiler
.
has_argument
(
flag
)
unity_c_args
+=
flag
endif
endforeach
unity
=
library
(
'unity'
,
'unity/src/unity.c'
,
c_args
:
unity_c_args
)
common
=
library
(
'test_common'
,
'common.c'
)
cjson_tests
=
[
'parse_examples'
,
'parse_number'
,
'parse_hex4'
,
'parse_string'
,
'parse_array'
,
'parse_object'
,
'parse_value'
,
'print_string'
,
'print_number'
,
'print_array'
,
'print_object'
,
'print_value'
,
'misc_tests'
,
'parse_with_opts'
,
'compare_tests'
]
foreach
cjson_test
:
cjson_tests
exe
=
executable
(
cjson_test
,
cjson_test
+
'.c'
,
link_with
:
[
common
,
cjson
,
unity
])
test
(
cjson_test
,
exe
,
workdir
:
meson
.
current_source_dir
())
endforeach
if
get_option
(
'enable_cjson_utils'
)
cjson_utils_tests
=
[
'json_patch_tests'
,
'old_utils_tests'
,
'misc_utils_tests'
]
foreach
cjson_utils_test
:
cjson_utils_tests
exe
=
executable
(
cjson_utils_test
,
cjson_utils_test
+
'.c'
,
link_with
:
[
common
,
cjson_utils
,
unity
,
cjson
])
test
(
cjson_utils_test
,
exe
,
workdir
:
meson
.
current_source_dir
())
endforeach
endif
endif
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment