Fix build issues related to Solaris and older GCC

Fixed two build issues:
 - JsonCPP currently doesn’t compile for Solaris due to platform
differences with ‘isfinite’ function.  Fixed by adding proper include
and define for Solaris.
 - JsonCPP currently doesn’t compile for GCC version 4.1.2 and earlier
due to use of ‘-Werror=*’ compile flag, which was introduced in a later
version.  Fixed by adding version check to only add this flag on
supported versions of GCC.
This commit is contained in:
dominicpezzuto 2014-12-27 16:45:40 -05:00
parent 54764dd85b
commit d2b6992f3e

View File

@ -11,7 +11,14 @@ ELSE(JSONCPP_LIB_BUILD_SHARED)
ENDIF(JSONCPP_LIB_BUILD_SHARED)
if( CMAKE_COMPILER_IS_GNUCXX )
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror=strict-aliasing")
#Get compiler version.
execute_process( COMMAND ${CMAKE_CXX_COMPILER} -dumpversion
OUTPUT_VARIABLE GNUCXX_VERSION )
#-Werror=* was introduced -after- GCC 4.1.2
if( GNUCXX_VERSION VERSION_GREATER 4.1.2 )
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror=strict-aliasing")
endif()
endif( CMAKE_COMPILER_IS_GNUCXX )
SET( JSONCPP_INCLUDE_DIR ../../include )