Commit Graph

19 Commits

Author SHA1 Message Date
Jun Zhang
8c5ecd1c01
Fix incorrectly CMAKE_BINARY_DIR usage
Similiar to CMAKE_SOURCE_DIR. Using CMAKE_BINARY_DIR will put the
generated header (stdlib.h) in build/include/solidity/libstdlib but it
should start with build/third-party/solidity or the library can't find
the header.

Signed-off-by: Jun Zhang <jun@junz.org>
2023-06-10 00:35:24 +08:00
Jun Zhang
74a38fc3d8
Fix incorrect CMAKE_SOURCE_DIR usage
When using solidity as a third-party library (include it into our
project using FetchContent), we encountered a strange compilation error.
For some reason, cmake considers the root directory of the project as
the root directory of the dependency (solidity). This is because
solidity is incorrectly using CMAKE_SOURCE_DIR variable, which should be
PROJECT_SOURCE_DIR (The former one refers to the top-level source
directory that contains a CMakeLists.txt, while the latter refers to the
source directory of the most recent project() command)

I've created a repo for demonstration (https://github.com/junaire/test-solidity-fetch-content)

Signed-off-by: Jun Zhang <jun@junz.org>
2023-06-08 19:17:34 +08:00
Daniel Kirchner
860226e25d Allow statically linked windows build in CMake. 2020-09-16 12:50:31 +02:00
Daniel Kirchner
0fd13b7a9e Upgrade json-cpp to 1.9.3. 2020-07-10 21:40:15 +02:00
Alex Beregszaszi
4edab3d76d Update to jsoncpp 1.9.2 2019-11-27 23:40:19 +01:00
Bhargava Shastry
ffbf7e6c7a jsoncpp: force explicit casts for integer to floating point conversions 2019-08-15 16:21:45 +02:00
Christian Parpart
e91c6acbc3 Defaulting to C++17 for building. 2019-08-13 16:19:18 +02:00
Christian Parpart
639622c6d7 cmake: Do not depend on a C compiler to be present by explicitly stating that this is a C++ project.
CMake defaults to C *and* C++ toolchain, in case nothing has been specified.
This means that cmake always checks for both, which is more than needed.

This PR cuts off C toolchain requirement from /CMakeLists.txt and ensures that we
don't pass along any `..._C_...` variables in EthCompilerSettings.cake nor jsoncpp.cmake.
2018-12-20 09:02:00 +01:00
Daniel Kirchner
2f698b6efe Use imported CMake targets. 2018-12-17 15:15:11 +01:00
Christian Parpart
5b86e3ec50 Enables C++14 standard (was C++11) within the Solidity compiler project. 2018-12-11 21:28:05 +01:00
Daniel Kirchner
fb0e3b25d0 Rename JSONCPP_EXTRA_FLAGS to JSONCPP_CXX_FLAGS, add EMSCRIPTEN workaround and remove obsolete MSVC workaround. 2018-08-08 13:17:13 +02:00
Guido Vranken
096cac5e65 Propagate original CMAKE_CXX_FLAGS to jsoncpp compilation 2018-07-19 00:05:45 +02:00
Christian Parpart
230317e9ff Visual Studio 2017 build-time (linking) fix and improvements 2018-07-10 19:10:29 +02:00
mingchuan
a104e5fb03
Fix cmake when custom CMAKE_INSTALL_LIBDIR is given
According to cmake documents, we cannot assume CMAKE_INSTALL_LIBDIR is a
relative path. This commit fixes the "no rule to make libjsoncpp.a"
error by passing -DCMAKE_INSTALL_LIBDIR=lib to jsoncpp external project.
2018-06-06 14:29:48 +08:00
Paweł Bylica
7db058074b
CMake: Fix libdir for jsoncpp external project in special case
When building on Debian/Ubuntu with install prefix /usr (e.g. in PPA builds) the CMAKE_INSTALL_LIBDIR is resolved to lib/x86_64-linux-gnu. For jsoncpp external project this is never the case because the install prefix is not /usr. Remove multiarch part from libdir if there.
2018-05-17 14:44:09 +02:00
Alex Beregszaszi
fa2a28abc2 CMake: enable C++11 for jsoncpp 2018-04-23 13:37:37 +01:00
Alexander Arlt
0b49fd3493 CMake: Update jsoncpp to v1.8.4 2018-04-23 11:10:39 +01:00
Paweł Bylica
4a499a38ea
jsoncpp: Restore download dir in source tree 2017-09-19 20:41:28 +02:00
Paweł Bylica
5706508332
deps: Move and fix jsoncpp.cmake from deps submodule
This copies jsoncpp.cmake from ethereum/cpp-dependencies repo and adds BUILD_BYPRODUCT information to ExternalProject configuration (required by Ninja).
2017-09-19 11:55:55 +02:00