Previously we only used it on GCC 6 to avoid deprecated declaration
warnings. Now we are proactive and use it whenever compiling as C++11
(or MSVC2010+).
It also moves the logic for deciding between unique_ptr and auto_ptr
into a single location in config.h.
This fixes some use cases that were previously broken, including:
* CXX=clang++ -std=c++11 -Werror=deprecated-declarations
* CXX=g++-6 -std=c++03 -Werror=deprecated-declarations
scoped_ptr has never been a part of the C++ standard - perhaps it's been
confused with boost::scoped_ptr. Anyhow, std::unique_ptr is the
replacement for the now-deprecated std::auto_ptr.
in 0.y.z branch -Werror was always being added regardless of the
what JSONCPP_WITH_WARNING_AS_ERROR was set to. Additionally,
-std=c++11 was being set on Clang builds.
* Clean up closing statements for if conditions, functions, macros,
and other entities. Newer versions of CMake do not require you to
redundantly respecify the parameters to the opening arguments.
This commit contains nothing but line ending normalization
changes. These changes were performed after the introduction
of .gitattributes into the repository.
-Werror shouldn't be used in released code since it can cause random build
failures on moderate warnings. It also depends on the used toolchain since
different toolchains may or may not print the same warnings.
`-std=c++11` for gcc builds too
There was an issue with Travis, but we seem to be past that now.
We were using only -std=c++0x for gcc, as you can see in the diff.
resolves#134
(was #300)
I got below warning message on x86 linux machine :
```
"jsoncpp-0.10.2-p1/include/json/config.h💯 warning: ISO C++ 1998 does not support ‘long long’"
gcc version 4.4.7 20120313 (Red Hat 4.4.7-4) (GCC)
```
In reference to
* https://github.com/open-source-parsers/jsoncpp/pull/292
**long long** is supported in c++-11; for old compilers i.e `0.y.z` branch this patch should be merged.
* http://help.appveyor.com/discussions/problems/2229-v140-not-found-on-vs2105rc
```
Done Building Project "C:\projects\jsoncpp\jsoncpp.sln" (default targets) -- FAILED.
Build FAILED.
"C:\projects\jsoncpp\jsoncpp.sln" (default target) (1) ->
"C:\projects\jsoncpp\ALL_BUILD.vcxproj.metaproj" (default target) (2) ->
"C:\projects\jsoncpp\ZERO_CHECK.vcxproj" (default target) (3) ->
(PlatformPrepareForBuild target) ->
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.Cpp.Platform.targets(64,5): error MSB8020: The build tools for v140 (Platform Toolset = 'v140') cannot be found. To build using the v140 build tools, please install v140 build tools. Alternatively, you may upgrade to the current Visual Studio tools by selecting the Project menu or right-click the solution, and then selecting "Upgrade Solution...". [C:\projects\jsoncpp\ZERO_CHECK.vcxproj]
```
fix appveyor 32-bit windows build
I've backed rebased under #297 because AppVeyor has been failing since there, and because that was not properly based on master anyway.
* http://help.appveyor.com/discussions/problems/2229-v140-not-found-on-vs2105rc
```
Done Building Project "C:\projects\jsoncpp\jsoncpp.sln" (default targets) -- FAILED.
Build FAILED.
"C:\projects\jsoncpp\jsoncpp.sln" (default target) (1) ->
"C:\projects\jsoncpp\ALL_BUILD.vcxproj.metaproj" (default target) (2) ->
"C:\projects\jsoncpp\ZERO_CHECK.vcxproj" (default target) (3) ->
(PlatformPrepareForBuild target) ->
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.Cpp.Platform.targets(64,5): error MSB8020: The build tools for v140 (Platform Toolset = 'v140') cannot be found. To build using the v140 build tools, please install v140 build tools. Alternatively, you may upgrade to the current Visual Studio tools by selecting the Project menu or right-click the solution, and then selecting "Upgrade Solution...". [C:\projects\jsoncpp\ZERO_CHECK.vcxproj]
```
When I arrived at the JsonCpp GitHub page, as an intermediate C++ developer, I could not figure out how to include JsonCpp into my project. The changes I propose to the README make this much clearer, and define a clear distinction between which instructions are for those developing and contributing to JsonCpp, and those who are just using it.
Do not prepend ${prefix} to substituted includedir & libdir
in the pkg-config file -- if the paths are overriden by user, CMake puts
absolute paths there (even if user specifies a relative path). Instead,
use the absolute path provided by CMake and appropriately default
LIBRARY_INSTALL_DIR & INCLUDE_INSTALL_DIR to absolute paths with
${CMAKE_INSTALL_PREFIX} prepended.
Fixes: https://github.com/open-source-parsers/jsoncpp/issues/279
Signed-off-by: Michał Górny <mgorny@gentoo.org>