-
Notifications
You must be signed in to change notification settings - Fork 6.3k
cmake/jsoncpp.cmake: update to jsoncpp v1.8.4 #3467
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,17 +6,15 @@ else() | |
| set(JSONCPP_CMAKE_COMMAND ${CMAKE_COMMAND}) | ||
| endif() | ||
|
|
||
| # Disable implicit fallthrough warning in jsoncpp for gcc >= 7 until the upstream handles it properly | ||
| if (("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 7.0) | ||
| set(JSONCCP_EXTRA_FLAGS -Wno-implicit-fallthrough) | ||
| else() | ||
| set(JSONCCP_EXTRA_FLAGS "") | ||
| endif() | ||
|
|
||
| include(GNUInstallDirs) | ||
| set(prefix "${CMAKE_BINARY_DIR}/deps") | ||
| set(JSONCPP_LIBRARY "${prefix}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}jsoncpp${CMAKE_STATIC_LIBRARY_SUFFIX}") | ||
| set(JSONCPP_LIBRARY "${prefix}/${CMAKE_INSTALL_LIBDIR}/${CMAKE_STATIC_LIBRARY_PREFIX}jsoncpp${CMAKE_STATIC_LIBRARY_SUFFIX}") | ||
| set(JSONCPP_INCLUDE_DIR "${prefix}/include") | ||
|
|
||
| if(NOT MSVC) | ||
| set(JSONCPP_EXTRA_FLAGS "-std=c++11") | ||
| endif() | ||
|
|
||
| set(byproducts "") | ||
| if(CMAKE_VERSION VERSION_GREATER 3.1) | ||
| set(byproducts BUILD_BYPRODUCTS "${JSONCPP_LIBRARY}") | ||
|
|
@@ -25,9 +23,9 @@ endif() | |
| ExternalProject_Add(jsoncpp-project | ||
| PREFIX "${prefix}" | ||
| DOWNLOAD_DIR "${CMAKE_SOURCE_DIR}/deps/downloads" | ||
| DOWNLOAD_NAME jsoncpp-1.7.7.tar.gz | ||
| URL https://github.com/open-source-parsers/jsoncpp/archive/1.7.7.tar.gz | ||
| URL_HASH SHA256=087640ebcf7fbcfe8e2717a0b9528fff89c52fcf69fa2a18cc2b538008098f97 | ||
| DOWNLOAD_NAME jsoncpp-1.8.4.tar.gz | ||
| URL https://github.com/open-source-parsers/jsoncpp/archive/1.8.4.tar.gz | ||
| URL_HASH SHA256=c49deac9e0933bcb7044f08516861a2d560988540b23de2ac1ad443b219afdb6 | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you try adding another CMAKE_ARGS:
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added. |
||
| CMAKE_COMMAND ${JSONCPP_CMAKE_COMMAND} | ||
| CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=<INSTALL_DIR> | ||
| -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} | ||
|
|
@@ -36,7 +34,7 @@ ExternalProject_Add(jsoncpp-project | |
| -DCMAKE_POSITION_INDEPENDENT_CODE=${BUILD_SHARED_LIBS} | ||
| -DJSONCPP_WITH_TESTS=OFF | ||
| -DJSONCPP_WITH_PKGCONFIG_SUPPORT=OFF | ||
| -DCMAKE_CXX_FLAGS=${JSONCCP_EXTRA_FLAGS} | ||
| -DCMAKE_CXX_FLAGS=${JSONCPP_EXTRA_FLAGS} | ||
| # Overwrite build and install commands to force Release build on MSVC. | ||
| BUILD_COMMAND cmake --build <BINARY_DIR> --config Release | ||
| INSTALL_COMMAND cmake --build <BINARY_DIR> --config Release --target install | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -32,7 +32,7 @@ REPO_ROOT="$(dirname "$0")"/.. | |
| fi | ||
| # Add dependencies | ||
| mkdir -p "$SOLDIR/deps/downloads/" 2>/dev/null || true | ||
| wget -O "$SOLDIR/deps/downloads/jsoncpp-1.7.7.tar.gz" https://github.com/open-source-parsers/jsoncpp/archive/1.7.7.tar.gz | ||
| wget -O "$SOLDIR/deps/downloads/jsoncpp-1.8.4.tar.gz" https://github.com/open-source-parsers/jsoncpp/archive/1.8.4.tar.gz | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is slightly unrelated to this PR, but I think this script should also check for the downloaded hash.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @chfast is it possible to run
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It should be possible by CMake will check the hash anyway, so no need to do it twice. |
||
| mkdir -p "$REPO_ROOT/upload" | ||
| tar czf "$REPO_ROOT/upload/solidity_$versionstring.tar.gz" -C "$TEMPDIR" "solidity_$versionstring" | ||
| rm -r "$TEMPDIR" | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,6 +18,8 @@ esac | |
|
|
||
| BIN=$PREFIX/bin | ||
|
|
||
| PATH=$PREFIX/bin:$PATH | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does this have any effect after the script has run? |
||
|
|
||
| if test -f $BIN/cmake && ($BIN/cmake --version | grep -q "$VERSION"); then | ||
| echo "CMake $VERSION already installed in $BIN" | ||
| else | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -76,7 +76,7 @@ mv solidity solc | |
|
|
||
| # Fetch jsoncpp dependency | ||
| mkdir -p ./solc/deps/downloads/ 2>/dev/null || true | ||
| wget -O ./solc/deps/downloads/jsoncpp-1.7.7.tar.gz https://github.com/open-source-parsers/jsoncpp/archive/1.7.7.tar.gz | ||
| wget -O ./solc/deps/downloads/jsoncpp-1.8.4.tar.gz https://github.com/open-source-parsers/jsoncpp/archive/1.8.4.tar.gz | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @chriseth why does the ppa script needs to download this separately? I thought cmake will do that on its own?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Because you cannot download anything in PPA builds. So you have to prepare the sources yourself. If you put the archive in the place where CMake would download it, it will only check the hash and unzip it from there.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not even with
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What I heard is the internet access is restricted only to official packages repo.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You have no internet access at all. You can declare dependencies on other packages, that's it, and I think this is a good thing: Building a package should be a deterministic, offline process. |
||
|
|
||
| # Determine version | ||
| cd solc | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@chfast isn't this pointing to some system wide directory?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
${CMAKE_INSTALL_LIBDIR}should be just"lib".There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean together with
prefix?Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@chfast if
${CMAKE_INSTALL_LIBDIR}would be justlib, we would have problems withlib64again, or am i wrong?