aboutsummaryrefslogtreecommitdiffstats
path: root/cmake/jsoncpp.cmake
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2018-09-14 00:38:41 +0800
committerGitHub <noreply@github.com>2018-09-14 00:38:41 +0800
commit59dbf8f1085b8b92e8b7eb0ce380cbeb642e97eb (patch)
tree76b1734d7360d73825f9737a1c7b530468f4bddd /cmake/jsoncpp.cmake
parente67f0147998a9e3835ed3ce8bf6a0a0c634216c5 (diff)
parent76812ed5675eb9d9bcd8f939adfec3ba4f02e970 (diff)
downloaddexon-solidity-59dbf8f1085b8b92e8b7eb0ce380cbeb642e97eb.tar
dexon-solidity-59dbf8f1085b8b92e8b7eb0ce380cbeb642e97eb.tar.gz
dexon-solidity-59dbf8f1085b8b92e8b7eb0ce380cbeb642e97eb.tar.bz2
dexon-solidity-59dbf8f1085b8b92e8b7eb0ce380cbeb642e97eb.tar.lz
dexon-solidity-59dbf8f1085b8b92e8b7eb0ce380cbeb642e97eb.tar.xz
dexon-solidity-59dbf8f1085b8b92e8b7eb0ce380cbeb642e97eb.tar.zst
dexon-solidity-59dbf8f1085b8b92e8b7eb0ce380cbeb642e97eb.zip
Merge pull request #4957 from ethereum/develop_v0425
Merge to release for 0.4.25
Diffstat (limited to 'cmake/jsoncpp.cmake')
-rw-r--r--cmake/jsoncpp.cmake22
1 files changed, 14 insertions, 8 deletions
diff --git a/cmake/jsoncpp.cmake b/cmake/jsoncpp.cmake
index 3d6b37ed..ea3218ef 100644
--- a/cmake/jsoncpp.cmake
+++ b/cmake/jsoncpp.cmake
@@ -6,13 +6,20 @@ else()
set(JSONCPP_CMAKE_COMMAND ${CMAKE_COMMAND})
endif()
-include(GNUInstallDirs)
set(prefix "${CMAKE_BINARY_DIR}/deps")
-set(JSONCPP_LIBRARY "${prefix}/${CMAKE_INSTALL_LIBDIR}/${CMAKE_STATIC_LIBRARY_PREFIX}jsoncpp${CMAKE_STATIC_LIBRARY_SUFFIX}")
+set(JSONCPP_LIBRARY "${prefix}/lib/${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")
+# TODO: Investigate why this breaks some emscripten builds and
+# check whether this can be removed after updating the emscripten
+# versions used in the CI runs.
+if(EMSCRIPTEN)
+ # Do not include all flags in CMAKE_CXX_FLAGS for emscripten,
+ # but only use -std=c++11. Using all flags causes build failures
+ # at the moment.
+ set(JSONCPP_CXX_FLAGS -std=c++11)
+else()
+ set(JSONCPP_CXX_FLAGS ${CMAKE_CXX_FLAGS})
endif()
set(byproducts "")
@@ -30,14 +37,13 @@ ExternalProject_Add(jsoncpp-project
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
+ -DCMAKE_INSTALL_LIBDIR=lib
# Build static lib but suitable to be included in a shared lib.
-DCMAKE_POSITION_INDEPENDENT_CODE=${BUILD_SHARED_LIBS}
-DJSONCPP_WITH_TESTS=OFF
-DJSONCPP_WITH_PKGCONFIG_SUPPORT=OFF
- -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
+ -DCMAKE_CXX_FLAGS=${JSONCPP_CXX_FLAGS}
+ -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
${byproducts}
)