Browse Source

Fix Windows build (#24)

* Fix Windows build

* Add AppVeyor CI builds

* Now fix Linux and macOS

* AppVeyor: fix artifact
cl-refactor
Paweł Bylica 8 years ago
committed by GitHub
parent
commit
18f37eb476
  1. 19
      appveyor.yml
  2. 5
      libdevcore/Common.h
  3. 10
      libdevcore/Log.cpp
  4. 2
      libdevcore/Log.h
  5. 2
      libethcore/CMakeLists.txt

19
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

5
libdevcore/Common.h

@ -28,11 +28,6 @@
#pragma warning(disable:4244)
#endif
#ifdef _MSC_VER
#define _ALLOW_KEYWORD_MACROS
#define noexcept throw()
#endif
#include <map>
#include <unordered_map>
#include <vector>

10
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() : "<unknown>";
return ThreadLocalLogName::name ? ThreadLocalLogName::name : "<unknown>";
#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
}

2
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();

2
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)

Loading…
Cancel
Save