Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
m0_62698959
jsoncpp
提交
c21b4bbf
J
jsoncpp
项目概览
m0_62698959
/
jsoncpp
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
J
jsoncpp
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
c21b4bbf
编写于
6月 25, 2017
作者:
C
Christopher Dunn
提交者:
GitHub
6月 25, 2017
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #625 from SoapGentoo/mesonise
Add initial Meson build file
上级
154652ee
d14d8c35
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
122 addition
and
20 deletion
+122
-20
.travis.yml
.travis.yml
+16
-8
meson.build
meson.build
+102
-0
travis.sh
travis.sh
+4
-12
未找到文件。
.travis.yml
浏览文件 @
c21b4bbf
...
...
@@ -7,14 +7,24 @@
# to allow C++11, though we are not yet building with -std=c++11
install
:
-
if [[ $TRAVIS_OS_NAME == osx ]]; then
brew update;
brew install python3 ninja;
python3 -m venv venv;
source venv/bin/activate;
elif [[ $TRAVIS_OS_NAME == linux ]]; then
wget https://github.com/ninja-build/ninja/releases/download/v1.7.2/ninja-linux.zip;
unzip -q ninja-linux.zip -d build;
fi
-
pip3 install meson
# /usr/bin/gcc is 4.6 always, but gcc-X.Y is available.
-
if [
"$CXX" = "g++"
]; then export CXX="g++-4.9" CC="gcc-4.9"; fi
-
if [
[ $CXX = g++ ]
]; then export CXX="g++-4.9" CC="gcc-4.9"; fi
# /usr/bin/clang has a conflict with gcc, so use clang-X.Y.
-
if [
"$CXX" = "clang++"
]; then export CXX="clang++-3.5" CC="clang-3.5"; fi
-
if [
[ $CXX = clang++ ]
]; then export CXX="clang++-3.5" CC="clang-3.5"; fi
-
echo ${PATH}
-
ls /usr/local
-
ls /usr/local/bin
-
export PATH=/usr/local/bin:/usr/bin:${PATH}
-
export PATH=
"${PWD}"/build:
/usr/local/bin:/usr/bin:${PATH}
-
echo ${CXX}
-
${CXX} --version
-
which valgrind
...
...
@@ -23,10 +33,7 @@ addons:
sources
:
-
ubuntu-toolchain-r-test
-
llvm-toolchain-precise-3.5
-
george-edison55-precise-backports
# cmake 3.2.3
packages
:
-
cmake
-
cmake-data
-
gcc-4.9
-
g++-4.9
-
clang-3.5
...
...
@@ -40,8 +47,9 @@ compiler:
script
:
./travis.sh
env
:
matrix
:
-
SHARED_LIB=ON STATIC_LIB=ON CMAKE_PKG=ON BUILD_TYPE=release VERBOSE_MAKE=fal
se
-
SHARED_LIB=OFF STATIC_LIB=ON CMAKE_PKG=OFF BUILD_TYPE=debug VERBOSE_MAKE=true VERBOSE
-
LIB_TYPE=static BUILD_TYPE=relea
se
-
LIB_TYPE=shared BUILD_TYPE=debug
notifications
:
email
:
false
dist
:
trusty
sudo
:
false
meson.build
0 → 100644
浏览文件 @
c21b4bbf
project(
'jsoncpp',
'cpp',
version : '1.8.0',
default_options : [
'buildtype=release',
'warning_level=1'],
license : 'Public Domain',
meson_version : '>= 0.41.1')
jsoncpp_ver_arr = meson.project_version().split('.')
jsoncpp_major_version = jsoncpp_ver_arr[0]
jsoncpp_minor_version = jsoncpp_ver_arr[1]
jsoncpp_patch_version = jsoncpp_ver_arr[2]
jsoncpp_cdata = configuration_data()
jsoncpp_cdata.set('JSONCPP_VERSION', meson.project_version())
jsoncpp_cdata.set('JSONCPP_VERSION_MAJOR', jsoncpp_major_version)
jsoncpp_cdata.set('JSONCPP_VERSION_MINOR', jsoncpp_minor_version)
jsoncpp_cdata.set('JSONCPP_VERSION_PATCH', jsoncpp_patch_version)
jsoncpp_gen_sources = configure_file(
input : 'src/lib_json/version.h.in',
output : 'version.h',
configuration : jsoncpp_cdata,
install : true,
install_dir : join_paths(get_option('prefix'), get_option('includedir'), 'json')
)
jsoncpp_headers = [
'include/json/allocator.h',
'include/json/assertions.h',
'include/json/autolink.h',
'include/json/config.h',
'include/json/features.h',
'include/json/forwards.h',
'include/json/json.h',
'include/json/reader.h',
'include/json/value.h',
'include/json/writer.h']
jsoncpp_include_directories = include_directories('include')
install_headers(
jsoncpp_headers,
subdir : 'json')
jsoncpp_lib = library(
'jsoncpp',
[ jsoncpp_gen_sources,
jsoncpp_headers,
'src/lib_json/json_tool.h',
'src/lib_json/json_reader.cpp',
'src/lib_json/json_value.cpp',
'src/lib_json/json_writer.cpp'],
soversion : 18,
install : true,
include_directories : jsoncpp_include_directories)
import('pkgconfig').generate(
libraries : jsoncpp_lib,
version : meson.project_version(),
name : 'jsoncpp',
filebase : 'jsoncpp',
description : 'A C++ library for interacting with JSON')
# for libraries bundling jsoncpp
declare_dependency(
include_directories : jsoncpp_include_directories,
link_with : jsoncpp_lib,
version : meson.project_version(),
sources : jsoncpp_gen_sources)
# tests
python = import('python3').find_python()
jsoncpp_test = executable(
'jsoncpp_test',
[ 'src/test_lib_json/jsontest.cpp',
'src/test_lib_json/jsontest.h',
'src/test_lib_json/main.cpp'],
include_directories : jsoncpp_include_directories,
link_with : jsoncpp_lib,
install : false)
test(
'unittest_jsoncpp_test',
jsoncpp_test)
jsontestrunner = executable(
'jsontestrunner',
'src/jsontestrunner/main.cpp',
include_directories : jsoncpp_include_directories,
link_with : jsoncpp_lib,
install : false)
test(
'unittest_jsontestrunner',
python,
args : [
'-B',
join_paths(meson.current_source_dir(), 'test/runjsontests.py'),
jsontestrunner,
join_paths(meson.current_source_dir(), 'test/data')]
)
travis.sh
浏览文件 @
c21b4bbf
...
...
@@ -17,15 +17,7 @@ set -vex
env
|
sort
cmake
-DJSONCPP_WITH_CMAKE_PACKAGE
=
$CMAKE_PKG
-DBUILD_SHARED_LIBS
=
$SHARED_LIB
-DCMAKE_BUILD_TYPE
=
$BUILD_TYPE
-DCMAKE_VERBOSE_MAKEFILE
=
$VERBOSE_MAKE
.
make
cmake
-DJSONCPP_WITH_CMAKE_PACKAGE
=
$CMAKE_PKG
-DBUILD_SHARED_LIBS
=
$SHARED_LIB
-DCMAKE_BUILD_TYPE
=
$BUILD_TYPE
-DCMAKE_VERBOSE_MAKEFILE
=
$VERBOSE_MAKE
-DJSONCPP_USE_SECURE_MEMORY
=
1
.
make
# Python is not available in Travis for osx.
# https://github.com/travis-ci/travis-ci/issues/2320
if
[
"
$TRAVIS_OS_NAME
"
!=
"osx"
]
then
make jsoncpp_check
valgrind
--error-exitcode
=
42
--leak-check
=
full ./src/test_lib_json/jsoncpp_test
fi
meson
--buildtype
${
BUILD_TYPE
}
--default-library
${
LIB_TYPE
}
.
build-
${
LIB_TYPE
}
ninja
-v
-C
build-
${
LIB_TYPE
}
ninja
-v
-C
build-
${
LIB_TYPE
}
test
rm
-r
build-
${
LIB_TYPE
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录