From c224a6fda767253808230f05064355dce8fad393 Mon Sep 17 00:00:00 2001 From: Jianping Wu Date: Sat, 20 Apr 2019 16:02:38 -0700 Subject: [PATCH] Build under "build" directory. --- CMakeLists.txt | 7 ++++++- README.md | 19 ++++++++----------- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4fe8fff..e544e13 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,5 +4,10 @@ project(keva-stratum) add_subdirectory(cnutil) -add_custom_target(build ALL DEPENDS cnutil COMMAND go build) +add_custom_target(build ALL DEPENDS cnutil COMMAND go get -d ../. COMMAND go build ..) + +if(MSYS) + add_custom_target(copy ALL COMMAND cp cnutil/libcnutil.dll .) +endif(MSYS) + diff --git a/README.md b/README.md index 6e4bc7e..4bed153 100644 --- a/README.md +++ b/README.md @@ -30,9 +30,7 @@ Use Ubuntu 16.04 LTS or 18.04 LTS. Install Golang and required packages: sudo apt-get install golang - go get "github.com/goji/httpauth" - go get "github.com/gorilla/mux" - go get "github.com/yvasiyarov/gorelic" + Clone stratum: @@ -41,6 +39,8 @@ Clone stratum: Build stratum: + mkdir build + cd build cmake . make @@ -49,9 +49,6 @@ Build stratum: Install Golang and required packages: brew update && brew install go - go get "github.com/goji/httpauth" - go get "github.com/gorilla/mux" - go get "github.com/yvasiyarov/gorelic" Clone stratum: @@ -60,6 +57,8 @@ Clone stratum: Build stratum: + mkdir build + cd build cmake . make @@ -87,9 +86,6 @@ Just like Monero, keva-stratum can be built on Windows using the MinGW toolchain Install Golang: pacman -S mingw-w64-x86_64-go - go get "github.com/goji/httpauth" - go get "github.com/gorilla/mux" - go get "github.com/yvasiyarov/gorelic" Clone stratum: @@ -98,6 +94,8 @@ Clone stratum: Build stratum: + mkdir build + cd build cmake -G "MSYS Makefiles" . **IMPORTANT: STOP AND CHECK** @@ -108,14 +106,13 @@ Check the output of `cmake` and make sure it finds the `OpenSSL` library, and th If the `OpenSSL` is not inside your `MSYS2` directory, `cmake` is not using the correct `OpenSSL` library. e.g. - -- Found OpenSSL: C:/OpenSSL-Win64/lib/libeay32.lib (found version "1.0.1a") + -- Found OpenSSL: C:/OpenSSL-Win64/lib/libeay32.lib (found version "1.0.2q") In the above case, you need to adjust the search path so that `cmake` uses the correct library. Now we are ready to build: make - cp cnutil/libcnutil.dll . ### Running Stratum