diff options
author | fireice-uk <fireice-uk@users.noreply.github.com> | 2017-05-02 17:34:24 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-02 17:34:24 +0100 |
commit | c3065ebe1b8c8cbe1ad7bfe5108decd9366ab8a2 (patch) | |
tree | 4ac1e3c3b82c1750e319c325ae656724e7308387 | |
parent | 924a1f8c8ae1be3526bcf3d8587076afebebcaee (diff) | |
parent | ab5b708b11adcd5096942f768de30c4040922033 (diff) | |
download | xmr-stak-c3065ebe1b8c8cbe1ad7bfe5108decd9366ab8a2.zip xmr-stak-c3065ebe1b8c8cbe1ad7bfe5108decd9366ab8a2.tar.gz |
Merge pull request #100 from psychocrypt/topic-allowDependencyDisable
allow to disable OpenSSL and microhttpd
-rw-r--r-- | CMakeLists.txt | 35 | ||||
-rw-r--r-- | README.md | 8 |
2 files changed, 20 insertions, 23 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 68d2432..2373d85 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -48,36 +48,33 @@ set(LIBS ${LIBS} ${CMAKE_THREAD_LIBS_INIT}) # Find microhttpd ################################################################################ -option(MICROHTTPD_REQUIRED "Enable or disable the requirement of microhttp (http deamon)" ON) -find_library(MHTD NAMES microhttpd) -if("${MHTD}" STREQUAL "MHTD-NOTFOUND") - if(MICROHTTPD_REQUIRED) - message(FATAL_ERROR "microhttpd NOT found: use `-DMICROHTTPD_REQUIRED=OFF` to build without http deamon support") +option(MICROHTTPD_ENABLE "Enable or disable the requirement of microhttp (http deamon)" ON) +if(MICROHTTPD_ENABLE) + find_library(MHTD NAMES microhttpd) + if("${MHTD}" STREQUAL "MHTD-NOTFOUND") + message(FATAL_ERROR "microhttpd NOT found: use `-DMICROHTTPD_ENABLE=OFF` to build without http deamon support") else() - message(STATUS "microhttpd NOT found: disable http server") - add_definitions("-DCONF_NO_HTTPD") + set(LIBS ${LIBS} ${MHTD}) endif() else() - set(LIBS ${LIBS} ${MHTD}) + add_definitions("-DCONF_NO_HTTPD") endif() ############################################################################### # Find OpenSSL ############################################################################### -option(OpenSSL_REQUIRED "Enable or disable the requirement of OpenSSL" ON) -find_package(OpenSSL) -if(OPENSSL_FOUND) - include_directories(${OPENSSL_INCLUDE_DIR}) - set(LIBS ${LIBS} ${OPENSSL_LIBRARIES}) -else() - if(OpenSSL_REQUIRED) - message(FATAL_ERROR "OpenSSL NOT found: use `-DOpenSSL_REQUIRED=OFF` to build without SSL support") +option(OpenSSL_ENABLE "Enable or disable the requirement of OpenSSL" ON) +if(OpenSSL_ENABLE) + find_package(OpenSSL) + if(OPENSSL_FOUND) + include_directories(${OPENSSL_INCLUDE_DIR}) + set(LIBS ${LIBS} ${OPENSSL_LIBRARIES}) else() - if(NOT OPENSSL_FOUND) - add_definitions("-DCONF_NO_TLS") - endif() + message(FATAL_ERROR "OpenSSL NOT found: use `-DOpenSSL_ENABLE=OFF` to build without SSL support") endif() +else() + add_definitions("-DCONF_NO_TLS") endif() ################################################################################ @@ -168,12 +168,12 @@ and install. -`CMAKE_BUILD_TYPE` set the build type - valid options: `Release` or `Debug` - you should always keep `Release` for your productive miners -- `MICROHTTPD_REQUIRED` allow to disable/enable the dependency *microhttpd* +- `MICROHTTPD_ENABLE` allow to disable/enable the dependency *microhttpd* - by default enabled - - there is no *http* interface available if option is disabled: `cmake . -DMICROHTTPD_REQUIRED=OFF` -- `OpenSSL_REQUIRED`allow to disable/enable the dependency *OpenSSL* + - there is no *http* interface available if option is disabled: `cmake . -DMICROHTTPD_ENABLE=OFF` +- `OpenSSL_ENABLE`allow to disable/enable the dependency *OpenSSL* - by default enabled - - it is not possible to connect to a *https* secured pool if optin is disabled: `cmake . -DOpenSSL_REQUIRED=OFF` + - it is not possible to connect to a *https* secured pool if optin is disabled: `cmake . -DOpenSSL_ENABLE=OFF` ## PGP Key ``` |