From 18f37eb476930ad02c8bf3b7e9728dedcc0daaec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Bylica?= Date: Mon, 15 May 2017 15:00:20 -0700 Subject: [PATCH] Fix Windows build (#24) * Fix Windows build * Add AppVeyor CI builds * Now fix Linux and macOS * AppVeyor: fix artifact --- appveyor.yml | 19 +++++++++++++++++++ libdevcore/Common.h | 5 ----- libdevcore/Log.cpp | 10 +++++----- libdevcore/Log.h | 2 +- libethcore/CMakeLists.txt | 2 +- 5 files changed, 26 insertions(+), 12 deletions(-) create mode 100644 appveyor.yml diff --git a/appveyor.yml b/appveyor.yml new file mode 100644 index 000000000..8fc889ced --- /dev/null +++ b/appveyor.yml @@ -0,0 +1,19 @@ +version: "{build}" +branches: + only: + - master +os: Visual Studio 2015 +configuration: + - Release +cache: + - C:/.hunter/_Base/Cache +install: +before_build: + - cmake -G "Visual Studio 14 2015 Win64" -H. -Bbuild +build: + project: c:/projects/ethminer/build/ethminer.sln + parallel: true + verbosity: minimal +artifacts: + - path: build/ethminer/Release/ethminer.exe + name: ethminer diff --git a/libdevcore/Common.h b/libdevcore/Common.h index 207abbbf5..93597f8a0 100644 --- a/libdevcore/Common.h +++ b/libdevcore/Common.h @@ -28,11 +28,6 @@ #pragma warning(disable:4244) #endif -#ifdef _MSC_VER -#define _ALLOW_KEYWORD_MACROS -#define noexcept throw() -#endif - #include #include #include diff --git a/libdevcore/Log.cpp b/libdevcore/Log.cpp index fc936e235..69e118ecb 100644 --- a/libdevcore/Log.cpp +++ b/libdevcore/Log.cpp @@ -162,18 +162,18 @@ string dev::getThreadName() buffer[127] = 0; return buffer; #else - return g_logThreadName.m_name.get() ? *g_logThreadName.m_name.get() : ""; + return ThreadLocalLogName::name ? ThreadLocalLogName::name : ""; #endif } -void dev::setThreadName(string const& _n) +void dev::setThreadName(char const* _n) { #if defined(__linux__) - pthread_setname_np(pthread_self(), _n.c_str()); + pthread_setname_np(pthread_self(), _n); #elif defined(__APPLE__) - pthread_setname_np(_n.c_str()); + pthread_setname_np(_n); #else - g_logThreadName.m_name.reset(new std::string(_n)); + ThreadLocalLogName::name = _n; #endif } diff --git a/libdevcore/Log.h b/libdevcore/Log.h index 4179d1f38..19e8aa0c0 100644 --- a/libdevcore/Log.h +++ b/libdevcore/Log.h @@ -76,7 +76,7 @@ public: }; /// Set the current thread's log name. -void setThreadName(std::string const& _n); +void setThreadName(char const* _n); /// Set the current thread's log name. std::string getThreadName(); diff --git a/libethcore/CMakeLists.txt b/libethcore/CMakeLists.txt index 6adb99551..82ed66e77 100644 --- a/libethcore/CMakeLists.txt +++ b/libethcore/CMakeLists.txt @@ -8,7 +8,7 @@ if (ETHASHCUDA) endif () add_library(ethcore ${SOURCES} ${HEADERS}) -target_link_libraries(ethcore ethash devcore pthread) +target_link_libraries(ethcore ethash devcore) if (ETHASHCL) target_link_libraries(ethcore ethash-cl)