Skip to content

Commit 532cba1

Browse files
authored
Merge pull request Tencent#4 from Tencent/master
Merge
2 parents 1391e42 + a091035 commit 532cba1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

90 files changed

+3825
-673
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,6 @@ Doxyfile
2323
Doxyfile.zh-cn
2424
DartConfiguration.tcl
2525
*.nupkg
26+
27+
# Files created by OS
28+
*.DS_Store

.travis.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
sudo: required
2-
dist: precise
2+
dist: trusty
3+
group: edge
34

45
language: cpp
56
cache:
@@ -13,7 +14,7 @@ env:
1314
- CCACHE_MAXSIZE=100M
1415
- ARCH_FLAGS_x86='-m32' # #266: don't use SSE on 32-bit
1516
- ARCH_FLAGS_x86_64='-msse4.2' # use SSE4.2 on 64-bit
16-
- GITHUB_REPO='miloyip/rapidjson'
17+
- GITHUB_REPO='Tencent/rapidjson'
1718
- secure: "HrsaCb+N66EG1HR+LWH1u51SjaJyRwJEDzqJGYMB7LJ/bfqb9mWKF1fLvZGk46W5t7TVaXRDD5KHFx9DPWvKn4gRUVkwTHEy262ah5ORh8M6n/6VVVajeV/AYt2C0sswdkDBDO4Xq+xy5gdw3G8s1A4Inbm73pUh+6vx+7ltBbk="
1819

1920
before_install:

CHANGELOG.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
109109
## [1.0.0] - 2015-04-22
110110

111111
### Added
112-
* 100% [Coverall](https://coveralls.io/r/miloyip/rapidjson?branch=master) coverage.
112+
* 100% [Coverall](https://coveralls.io/r/Tencent/rapidjson?branch=master) coverage.
113113
* Version macros (#311)
114114

115115
### Fixed
@@ -140,7 +140,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
140140
* Redo all documentation (English, Simplified Chinese)
141141

142142
### Changed
143-
* Copyright ownership transfered to THL A29 Limited (a Tencent company).
143+
* Copyright ownership transferred to THL A29 Limited (a Tencent company).
144144
* Migrating from Premake to CMAKE (#192)
145145
* Resolve all warning reports
146146

@@ -151,8 +151,8 @@ This project adheres to [Semantic Versioning](http://semver.org/).
151151

152152
## 0.1 - 2011-11-18
153153

154-
[Unreleased]: https://github.com/miloyip/rapidjson/compare/v1.1.0...HEAD
155-
[1.1.0]: https://github.com/miloyip/rapidjson/compare/v1.0.2...v1.1.0
156-
[1.0.2]: https://github.com/miloyip/rapidjson/compare/v1.0.1...v1.0.2
157-
[1.0.1]: https://github.com/miloyip/rapidjson/compare/v1.0.0...v1.0.1
158-
[1.0.0]: https://github.com/miloyip/rapidjson/compare/v1.0-beta...v1.0.0
154+
[Unreleased]: https://github.com/Tencent/rapidjson/compare/v1.1.0...HEAD
155+
[1.1.0]: https://github.com/Tencent/rapidjson/compare/v1.0.2...v1.1.0
156+
[1.0.2]: https://github.com/Tencent/rapidjson/compare/v1.0.1...v1.0.2
157+
[1.0.1]: https://github.com/Tencent/rapidjson/compare/v1.0.0...v1.0.1
158+
[1.0.0]: https://github.com/Tencent/rapidjson/compare/v1.0-beta...v1.0.0

CMakeLists.txt

Lines changed: 28 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,16 @@ option(RAPIDJSON_BUILD_THIRDPARTY_GTEST
3131
"Use gtest installation in `thirdparty/gtest` by default if available" OFF)
3232

3333
option(RAPIDJSON_BUILD_CXX11 "Build rapidjson with C++11 (gcc/clang)" ON)
34+
if(RAPIDJSON_BUILD_CXX11)
35+
set(CMAKE_CXX_STANDARD 11)
36+
set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
37+
endif()
3438

3539
option(RAPIDJSON_BUILD_ASAN "Build rapidjson with address sanitizer (gcc/clang)" OFF)
3640
option(RAPIDJSON_BUILD_UBSAN "Build rapidjson with undefined behavior sanitizer (gcc/clang)" OFF)
3741

42+
option(RAPIDJSON_ENABLE_INSTRUMENTATION_OPT "Build rapidjson with -march or -mcpu options" ON)
43+
3844
option(RAPIDJSON_HAS_STDSTRING "" OFF)
3945
if(RAPIDJSON_HAS_STDSTRING)
4046
add_definitions(-DRAPIDJSON_HAS_STDSTRING)
@@ -49,16 +55,18 @@ if(CCACHE_FOUND)
4955
endif()
5056
endif(CCACHE_FOUND)
5157

52-
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
53-
if(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "powerpc" OR ${CMAKE_SYSTEM_PROCESSOR} STREQUAL "ppc64" OR ${CMAKE_SYSTEM_PROCESSOR} STREQUAL "ppc64le")
54-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mcpu=native")
55-
else()
56-
#FIXME: x86 is -march=native, but doesn't mean every arch is this option. To keep original project's compatibility, I leave this except POWER.
57-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native")
58+
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
59+
if(RAPIDJSON_ENABLE_INSTRUMENTATION_OPT AND NOT CMAKE_CROSSCOMPILING)
60+
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "powerpc" OR CMAKE_SYSTEM_PROCESSOR STREQUAL "ppc64" OR CMAKE_SYSTEM_PROCESSOR STREQUAL "ppc64le")
61+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mcpu=native")
62+
else()
63+
#FIXME: x86 is -march=native, but doesn't mean every arch is this option. To keep original project's compatibility, I leave this except POWER.
64+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native")
65+
endif()
5866
endif()
5967
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Werror")
6068
set(EXTRA_CXX_FLAGS -Weffc++ -Wswitch-default -Wfloat-equal -Wconversion -Wsign-conversion)
61-
if (RAPIDJSON_BUILD_CXX11)
69+
if (RAPIDJSON_BUILD_CXX11 AND CMAKE_VERSION VERSION_LESS 3.1)
6270
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.7.0")
6371
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
6472
else()
@@ -80,15 +88,17 @@ if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
8088
endif()
8189
endif()
8290
elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
83-
if(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "powerpc" OR ${CMAKE_SYSTEM_PROCESSOR} STREQUAL "ppc64" OR ${CMAKE_SYSTEM_PROCESSOR} STREQUAL "ppc64le")
84-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mcpu=native")
85-
else()
86-
#FIXME: x86 is -march=native, but doesn't mean every arch is this option. To keep original project's compatibility, I leave this except POWER.
87-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native")
91+
if(NOT CMAKE_CROSSCOMPILING)
92+
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "powerpc" OR CMAKE_SYSTEM_PROCESSOR STREQUAL "ppc64" OR CMAKE_SYSTEM_PROCESSOR STREQUAL "ppc64le")
93+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mcpu=native")
94+
else()
95+
#FIXME: x86 is -march=native, but doesn't mean every arch is this option. To keep original project's compatibility, I leave this except POWER.
96+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native")
97+
endif()
8898
endif()
8999
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Werror -Wno-missing-field-initializers")
90-
set(EXTRA_CXX_FLAGS -Weffc++ -Wswitch-default -Wfloat-equal -Wconversion -Wimplicit-fallthrough -Weverything)
91-
if (RAPIDJSON_BUILD_CXX11)
100+
set(EXTRA_CXX_FLAGS -Weffc++ -Wswitch-default -Wfloat-equal -Wconversion -Wimplicit-fallthrough)
101+
if (RAPIDJSON_BUILD_CXX11 AND CMAKE_VERSION VERSION_LESS 3.1)
92102
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
93103
endif()
94104
if (RAPIDJSON_BUILD_ASAN)
@@ -101,7 +111,7 @@ elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
101111
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=undefined")
102112
endif()
103113
endif()
104-
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
114+
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
105115
add_definitions(-D_CRT_SECURE_NO_WARNINGS=1)
106116
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc")
107117
elseif (CMAKE_CXX_COMPILER_ID MATCHES "XL")
@@ -118,7 +128,7 @@ IF(UNIX OR CYGWIN)
118128
ELSEIF(WIN32)
119129
SET(_CMAKE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/cmake")
120130
ENDIF()
121-
SET(CMAKE_INSTALL_DIR "${_CMAKE_INSTALL_DIR}" CACHE PATH "The directory cmake fiels are installed in")
131+
SET(CMAKE_INSTALL_DIR "${_CMAKE_INSTALL_DIR}" CACHE PATH "The directory cmake files are installed in")
122132

123133
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
124134

@@ -181,6 +191,8 @@ EXPORT( PACKAGE ${PROJECT_NAME} )
181191
# ... for the build tree
182192
SET( CONFIG_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
183193
SET( CONFIG_DIR ${CMAKE_CURRENT_BINARY_DIR})
194+
SET( ${PROJECT_NAME}_INCLUDE_DIR "\${${PROJECT_NAME}_SOURCE_DIR}/include" )
195+
184196
CONFIGURE_FILE( ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}Config.cmake.in
185197
${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake @ONLY )
186198
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}ConfigVersion.cmake.in

RapidJSON.pc.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ includedir=@INCLUDE_INSTALL_DIR@
33
Name: @PROJECT_NAME@
44
Description: A fast JSON parser/generator for C++ with both SAX/DOM style API
55
Version: @LIB_VERSION_STRING@
6-
URL: https://github.com/miloyip/rapidjson
6+
URL: https://github.com/Tencent/rapidjson
77
Cflags: -I${includedir}

bin/jsonschema/remotes/.DS_Store

-6 KB
Binary file not shown.

bin/jsonschema/tests/.DS_Store

-6 KB
Binary file not shown.

bin/jsonschema/tests/draft4/.DS_Store

-6 KB
Binary file not shown.

contrib/natvis/LICENSE

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2017 Bart Muzzin
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.
22+
23+
Derived from:
24+
25+
The MIT License (MIT)
26+
27+
Copyright (c) 2015 mojmir svoboda
28+
29+
Permission is hereby granted, free of charge, to any person obtaining a copy
30+
of this software and associated documentation files (the "Software"), to deal
31+
in the Software without restriction, including without limitation the rights
32+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
33+
copies of the Software, and to permit persons to whom the Software is
34+
furnished to do so, subject to the following conditions:
35+
36+
The above copyright notice and this permission notice shall be included in all
37+
copies or substantial portions of the Software.
38+
39+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
40+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
41+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
42+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
43+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
44+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
45+
SOFTWARE.

contrib/natvis/README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# rapidjson.natvis
2+
3+
This file can be used as a [Visual Studio Visualizer](https://docs.microsoft.com/en-gb/visualstudio/debugger/create-custom-views-of-native-objects) to aid in visualizing rapidjson structures within the Visual Studio debugger. Natvis visualizers are supported in Visual Studio 2012 and later. To install, copy the file into this directory:
4+
5+
`%USERPROFILE%\Documents\Visual Studio 2012\Visualizers`
6+
7+
Each version of Visual Studio has a similar directory, it must be copied into each directory to be used with that particular version. In Visual Studio 2015 and later, this can be done without restarting Visual Studio (a new debugging session must be started).

0 commit comments

Comments
 (0)