aboutsummaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
Diffstat (limited to 'cmake')
-rw-r--r--cmake/EthCompilerSettings.cmake20
-rw-r--r--cmake/EthDependencies.cmake57
2 files changed, 2 insertions, 75 deletions
diff --git a/cmake/EthCompilerSettings.cmake b/cmake/EthCompilerSettings.cmake
index 4ce9d22d..9b294e27 100644
--- a/cmake/EthCompilerSettings.cmake
+++ b/cmake/EthCompilerSettings.cmake
@@ -63,13 +63,6 @@ if (("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") OR ("${CMAKE_CXX_COMPILER_ID}" MA
# Applying -fpermissive to a C command-line (ie. secp256k1) gives a build error.
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fpermissive")
- # Build everything as shared libraries (.so files)
- add_definitions(-DSHAREDLIB)
-
- # If supported for the target machine, emit position-independent code, suitable for dynamic
- # linking and avoiding any limit on the size of the global offset table.
- add_compile_options(-fPIC)
-
# Configuration-specific compiler settings.
set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g -DETH_DEBUG")
set(CMAKE_CXX_FLAGS_MINSIZEREL "-Os -DNDEBUG")
@@ -198,7 +191,6 @@ elseif (DEFINED MSVC)
add_compile_options(/wd4800) # disable forcing value to bool 'true' or 'false' (performance warning) (4800)
add_compile_options(-D_WIN32_WINNT=0x0600) # declare Windows Vista API requirement
add_compile_options(-DNOMINMAX) # undefine windows.h MAX && MIN macros cause it cause conflicts with std::min && std::max functions
- add_compile_options(-DMINIUPNP_STATICLIB) # define miniupnp static library
# Always use Release variant of C++ runtime.
# We don't want to provide Debug variants of all dependencies. Some default
@@ -218,12 +210,6 @@ elseif (DEFINED MSVC)
# stack size 16MB
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /ignore:4099,4075 /STACK:16777216")
- # windows likes static
- if (NOT ETH_STATIC)
- message("Forcing static linkage for MSVC.")
- set(ETH_STATIC 1)
- endif ()
-
# If you don't have GCC, Clang or VC++ then you are on your own. Good luck!
else ()
message(WARNING "Your compiler is not tested, if you run into any issues, we'd welcome any patches.")
@@ -262,9 +248,3 @@ if (("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") OR ("${CMAKE_CXX_COMPILER_ID}" MA
endif ()
endif ()
endif ()
-
-if(ETH_STATIC)
- set(BUILD_SHARED_LIBS OFF)
-else()
- set(BUILD_SHARED_LIBS ON)
-endif(ETH_STATIC)
diff --git a/cmake/EthDependencies.cmake b/cmake/EthDependencies.cmake
index a5e9b0c5..39ce060e 100644
--- a/cmake/EthDependencies.cmake
+++ b/cmake/EthDependencies.cmake
@@ -43,62 +43,9 @@ find_program(CTEST_COMMAND ctest)
## use multithreaded boost libraries, with -mt suffix
set(Boost_USE_MULTITHREADED ON)
+option(Boost_USE_STATIC_LIBS "Link Boost statically" ON)
-if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
-
-# use static boost libraries *.lib
- set(Boost_USE_STATIC_LIBS ON)
-
-elseif (APPLE)
-
-# use static boost libraries *.a
- set(Boost_USE_STATIC_LIBS ON)
-
-elseif (UNIX)
-# use dynamic boost libraries *.dll
- set(Boost_USE_STATIC_LIBS OFF)
-
-endif()
-
-set(STATIC_LINKING FALSE CACHE BOOL "Build static binaries")
-
-if (STATIC_LINKING)
-
- set(Boost_USE_STATIC_LIBS ON)
- set(Boost_USE_STATIC_RUNTIME ON)
-
- set(OpenSSL_USE_STATIC_LIBS ON)
-
- if (MSVC)
- # TODO - Why would we need .a on Windows? Maybe some Cygwin-ism.
- # When I work through Windows static linkage, I will remove this,
- # if that is possible.
- set(CMAKE_FIND_LIBRARY_SUFFIXES .lib .a ${CMAKE_FIND_LIBRARY_SUFFIXES})
- elseif (APPLE)
- # At the time of writing, we are still only PARTIALLY statically linked
- # on OS X, with a mixture of statically linked external libraries where
- # those are available, and dynamically linked where that is the only
- # option we have. Ultimately, the aim would be for everything except
- # the runtime libraries to be statically linked.
- #
- # Still TODO:
- # - jsoncpp
- # - json-rpc-cpp
- # - leveldb (which pulls in snappy, for the dylib at ;east)
- # - miniupnp
- # - gmp
- #
- # Two further libraries (curl and zlib) ship as dylibs with the platform
- # but again we could build from source and statically link these too.
- set(CMAKE_FIND_LIBRARY_SUFFIXES .a .dylib)
- else()
- set(CMAKE_FIND_LIBRARY_SUFFIXES .a)
- endif()
-
- set(ETH_STATIC ON)
-endif()
-
-find_package(Boost 1.54.0 QUIET REQUIRED COMPONENTS thread date_time system regex chrono filesystem unit_test_framework program_options random)
+find_package(Boost 1.54.0 QUIET REQUIRED COMPONENTS regex filesystem unit_test_framework program_options)
eth_show_dependency(Boost boost)