From 96f1e772d02800c5540e995a2d4f9df930fb810b Mon Sep 17 00:00:00 2001 From: Marek Kotewicz Date: Wed, 11 Feb 2015 15:17:26 +0100 Subject: [PATCH] fixed compile errors when using old version of jsonrpcstub, fixed #1003 --- cmake/scripts/jsonrpcstub.cmake | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/cmake/scripts/jsonrpcstub.cmake b/cmake/scripts/jsonrpcstub.cmake index a9b2c44ab..39f850e53 100644 --- a/cmake/scripts/jsonrpcstub.cmake +++ b/cmake/scripts/jsonrpcstub.cmake @@ -27,10 +27,19 @@ set(CLIENT_OUTFILE "${ETH_CLIENT_DIR}/${ETH_CLIENT_NAME_LOWER}.h") execute_process( COMMAND ${ETH_JSON_RPC_STUB} ${ETH_SPEC_PATH} --cpp-server=${ETH_SERVER_NAME} --cpp-server-file=${SERVER_TMPFILE} - --cpp-client=${ETH_CLIENT_NAME} --cpp-client-file=${CLIENT_TMPFILE} + --cpp-client=${ETH_CLIENT_NAME} --cpp-client-file=${CLIENT_TMPFILE} + OUTPUT_VARIABLE ERR ERROR_QUIET ) -include("${ETH_SOURCE_DIR}/cmake/EthUtils.cmake") -replace_if_different("${SERVER_TMPFILE}" "${SERVER_OUTFILE}") -replace_if_different("${CLIENT_TMPFILE}" "${CLIENT_OUTFILE}") +# don't throw fatal error on jsonrpcstub error, someone might have old version of jsonrpcstub, +# he does not need to upgrade it if he is not working on JSON RPC +# show him warning instead +if (ERR) + message(WARNING "Your version of jsonrcpstub tool is not supported. Please upgrade it.") + message(WARNING "${ERR}") +else() + include("${ETH_SOURCE_DIR}/cmake/EthUtils.cmake") + replace_if_different("${SERVER_TMPFILE}" "${SERVER_OUTFILE}") + replace_if_different("${CLIENT_TMPFILE}" "${CLIENT_OUTFILE}") +endif()