45 Commits

Author SHA1 Message Date
Sergey Fedorov
083f359f5c CMakeLists: fix optflags for ppc 2023-03-06 14:36:52 +08:00
Steve Hanson
7cad78e236 tidy up after merge from master 2022-12-01 00:42:44 +08:00
Steve Hanson
794248ee62 fix build break 2022-12-01 00:42:44 +08:00
Ivan Le Lann
e6736d1baa
Support CMake none targets
When trying to import rapidjson with for exemple : 
fetchcontent_declare(rapidjson GIT_REPOSITORY https://github.com/Tencent/rapidjson.git)

if your CMake/Clang is "bare metal", exemple given : 

set(CMAKE_SYSTEM_NAME none)
set(CMAKE_SYSTEM_PROCESSOR x86_64)
set(CMAKE_C_COMPILER_TARGET x86_64-elf-none)
set(CMAKE_CXX_COMPILER_TARGET x86_64-elf-none)

CMake fails to process CMakeLists.txt because of the switch on UNIX/CYGWIN/WIN32 for install directory.

Error is: 

CMake Error at cmake-build-debug-clang/_deps/rapidjson-src/CMakeLists.txt:244 (INSTALL):
  INSTALL FILES given no DESTINATION!
2021-10-02 15:26:17 +02:00
ylavic
71f0fa7eb3 Set RAPIDJSON_USE_MEMBERSMAP to use a (std::multi)map for object members.
When RAPIDJSON_USE_MEMBERSMAP is defined, an object Value will store
its members in an (re)allocated array of Members like before, but also
in an std::multimap<GenericValue::Data,SizeType> where the key and value
reference the corresponding Member by its Data and index in the array,
respectively, and in a relocatable manner.

The layout of the members map/array is now:
 {multimap*}<>{capacity}<>{Member[capacity]}<>{multimap::iterator[capacity]}
where <> stands for the RAPIDJSON_ALIGN-ment of each part, if needed.

This layout needs to be reallocated when the current capacity is
exhausted, which requires to take care of the multimap and its iterators
explicitely. The multimap is allocated separately and only its pointer is
saved in this layout, so it can easily be restored in its new position.
As for the old/alive iterators, they must move to their new offset according
to the new capacity.

With this in place, it's immediate to get the multimap::iterator from a
MemberIterator and vice versa, thus the same complexity applies for the
operations with MemberIterator or MapIterator.

For FindMember() and RemoveMember(), the complexity drops from O(n) to
the multimap/rbtree's O(log n).
For EraseMember() it drops from O(n-m) to O((log n)-m), m representing
the move/copy of the trailing members.
For AddMember() though, the complexity grows from O(1) to O(log n) due to
the insertion in the multimap too.

Consequently parsing will be slower, up to ~20% measured in perftests on
my laptop (since it's mainly composed of insertions). But later work on
the Document (usually the goal of parsing...) will be much faster; the
new DocumentFind perftest included in this commit is 8 times faster with
RAPIDJSON_USE_MEMBERSMAP (still on my laptop). Overall the tests are 4%
slower (mainly composed of parsing), and notably 15% slower for schemas
parsing/validation (which supposedly comes from the larger JSON files
parsing, still). As a side note, when RAPIDJSON_USE_MEMBERSMAP is not
defined, this commit does nothing (same results for perftest with regard
to previous versions).

Finally, the multimap is allocated and constructed using StdAllocator,
so they will use the same Allocator than for any other Value allocation,
and thus will benefit from the same performance/safety/security/whatever
provided by the user given Allocator.
2021-04-07 18:22:46 +02:00
ylavic
e336667b4a Handle C++17 (and C++11 with MSVC) in CI. 2021-03-30 10:12:36 +02:00
piratf
46d980b46a fix CMake policy CMP0048 warning #1154 2019-11-11 16:09:43 +08:00
Ruslan Bilovol
8d272e53a4 CMake: remove hardcoded CMAKECONFIG_INSTALL_DIR path
Currently this path is hardcoded to lib/cmake.
Some distributions have different library path (like lib64).
So reuse LIB_INSTALL_DIR for that to make CMAKECONFIG_INSTALL_DIR
configurable and usable in such distros.

Signed-off-by: Ruslan Bilovol <rbilovol@cisco.com>
2019-01-24 18:38:14 +02:00
luz.paz
915218878a Misc. typos
Found via `codespell -q 3` in  downstream https://github.com/BlueBrain/Brayns
2018-02-19 06:42:52 -05:00
Rolf Eike Beer
ff59b6179d CMake: automatically handle C++11 settings if possible 2017-11-24 17:00:53 +01:00
Rolf Eike Beer
4c9a28a28e CMake: do not pass -march=native or -mcpu=native when crosscompiling 2017-11-24 16:58:42 +01:00
Rolf Eike Beer
4e1c7363cc CMake: avoid neeless variable expansion
CMake will automatically expand strings that are variable names in if().
2017-11-24 16:58:42 +01:00
M.Tayel
f4b1f761f3 Fixed typo in CMake file 2017-10-24 12:25:47 +02:00
M.Tayel
7bd9b5a1ad enable cross compiling by adding option to remove -march/-cpu 2017-10-16 15:01:27 +02:00
Captain Crutches
495266271f Use SOURCE_DIR instead of CMAKE_DIR for build tree 2017-10-08 23:43:18 -04:00
Captain Crutches
84ca485e51 Make RapidJSON_INCLUDE_DIR non-blank in Config.cmake 2017-10-02 20:39:40 -04:00
Crunkle
9ce6a7ebb8 Fix processor check when empty 2017-09-02 21:05:00 +01:00
Milo Yip
f8eb7bae89 Remove -Weverything
See #930
2017-05-12 10:32:06 +08:00
Clemens Arth
b91c515afe update to create config file which is independent from actual install location 2017-03-14 10:27:36 +01:00
Zhihao Yuan
3cc77d5d63
Treat signed-unsigned conversions as errors. 2017-01-18 18:09:18 -06:00
Wu Zhao
c4db88a314 support IBM PowerPC / ppc64 / ppc64le and XL compiler
Avoid POWER platform compiling error and support IBM XL C++ compiler on
Linux / AIX.
2016-10-26 17:27:54 +08:00
Milo Yip
17254e090e Version 1.1.0
Change version numbers
Fixed some document linkage
Fix #648
2016-08-25 14:35:17 +08:00
Eli Fidler
56bb9992b0 support building with ASAN and UBSAN on Clang and GCC 2016-06-13 07:24:26 -07:00
Milo Yip
aae2fbfc99 Try to fix cmake CMP0054 warning 2016-04-21 23:12:31 +08:00
Milo Yip
c843a2655b Try to fix all /W4 warnings in VC2015 2016-04-04 15:01:34 +08:00
Milo Yip
ae840f66c5 Remerge #504 2016-02-23 14:21:03 +08:00
Milo Yip
b515627446 CMake use RelWithDebInfo as default #319 2016-01-31 01:17:29 +08:00
Milo Yip
2f5a69b2fb Try using c++0x for gcc 4.6.x 2016-01-23 14:58:19 +08:00
Milo Yip
a6eb15d274 Fix warnings in clang for C++11 2016-01-23 14:37:15 +08:00
Justin Scheiber
e527a4fe5e adding -Wno-missing-field-initializers to keep the googletest source from erroring out on a warning 2015-07-21 17:42:28 -06:00
scheiber
a0f730e3d7 use -Werror 2015-07-21 16:42:50 -06:00
Milo Yip
0e9fe888b7 v1.0.2 release 2015-05-14 15:49:26 +08:00
Phyks
89ad34cef4 Fix CMakeLists for include as a thirdparty in projects 2015-05-12 00:23:50 +02:00
Milo Yip
316292d518 Change version to 1.0.1 2015-04-25 09:52:59 +08:00
Milo Yip
7f43373a12 Merge pull request #311 from miloyip/issue310_versionmacro
RapidJSON v1.0.0
2015-04-22 10:26:03 +08:00
Andrii Senkovych
04b673686a Introduce option to select default gtest installation. Refs #309
This will introduce RAPIDJSON_BUILD_THIRDPARTY_GTEST option. If it is set to
TRUE, cmake will look for GTest installation in `thirdparty/gtest` before
looking in other places.

Current default value (OFF) for RAPIDJSON_BUILD_THIRDPARTY_GTEST represents
previous behaviour when system-wide gtest installation is used whenever
possible.

This commit will as well eliminate problem described in #309 when source
directory found is `thirdparty/gtest` while include files are found
system-wide. This however won't give the user possibility to select gtest
installation to use.
2015-04-21 13:33:44 +03:00
miloyip
5ab1e9361d Add version macros for RapidJSON 2015-04-21 16:38:49 +08:00
thebusytypist
58cd253f8f Exclude intermediate files from install. 2015-03-24 13:50:02 +08:00
Andrii Senkovych
122170b362 Fix definitions for VS compiler 2015-02-23 20:21:07 +02:00
Andrii Senkovych
3ae2a29986 Backport compiler options from premake configuration. Refs #240. 2015-02-19 18:25:40 +02:00
unknown
a3398a862b removed tabs from cmake config file 2015-02-17 13:58:31 +01:00
unknown
63ad11c367 add support for AppVeyor CI for checking Windows builds 2015-02-17 10:42:43 +01:00
Andriy Senkovych
40c03114e3 Try new travis configuration 2014-11-19 03:13:06 +02:00
Andriy Senkovych
d69991fa11 Set separate directory to place binaries 2014-11-11 17:26:59 +02:00
Andriy Senkovych
8ae1c971ea Add initial CMake support
* Support for both in-source and out-of-source builds
 * Set library version to 0.12 to map Debian package
 * Add separate options to build tests, examples and documentation
 * Add pkgconfig lookup support (if installed with `make install`)
 * Add CMake lookup support (if isntalled with `make install`)
 * Add Google Test Source lookup
 * Add CTest support for running tests (use `make test` or `ctest -V`)
2014-11-11 17:26:59 +02:00