mirror of
https://github.com/xmrig/xmrig.git
synced 2024-11-17 08:17:40 +00:00
Move files.
This commit is contained in:
parent
ba68fb6c53
commit
0d86e53a32
10 changed files with 74 additions and 150 deletions
|
@ -16,50 +16,21 @@ option(WITH_EMBEDDED_CONFIG "Enable internal embedded JSON config" OFF)
|
||||||
|
|
||||||
include (CheckIncludeFile)
|
include (CheckIncludeFile)
|
||||||
include (cmake/cpu.cmake)
|
include (cmake/cpu.cmake)
|
||||||
|
include (src/base/base.cmake)
|
||||||
|
|
||||||
|
|
||||||
set(HEADERS
|
set(HEADERS
|
||||||
|
"${HEADERS_BASE}"
|
||||||
src/api/NetworkState.h
|
src/api/NetworkState.h
|
||||||
src/App.h
|
src/App.h
|
||||||
src/base/io/Json.h
|
|
||||||
src/base/io/Watcher.h
|
|
||||||
src/base/kernel/Entry.h
|
|
||||||
src/base/kernel/interfaces/IClientListener.h
|
|
||||||
src/base/kernel/interfaces/IConfigListener.h
|
|
||||||
src/base/kernel/interfaces/IDnsListener.h
|
|
||||||
src/base/kernel/interfaces/ILineListener.h
|
|
||||||
src/base/kernel/interfaces/ISignalListener.h
|
|
||||||
src/base/kernel/interfaces/IStrategy.h
|
|
||||||
src/base/kernel/interfaces/IStrategyListener.h
|
|
||||||
src/base/kernel/interfaces/IWatcherListener.h
|
|
||||||
src/base/kernel/Process.h
|
|
||||||
src/base/kernel/Signals.h
|
|
||||||
src/base/net/dns/Dns.h
|
|
||||||
src/base/net/dns/DnsRecord.h
|
|
||||||
src/base/net/stratum/Client.h
|
|
||||||
src/base/net/stratum/Job.h
|
|
||||||
src/base/net/stratum/Pool.h
|
|
||||||
src/base/net/stratum/Pools.h
|
|
||||||
src/base/net/stratum/strategies/FailoverStrategy.h
|
|
||||||
src/base/net/stratum/strategies/SinglePoolStrategy.h
|
|
||||||
src/base/net/stratum/SubmitResult.h
|
|
||||||
src/base/net/tools/RecvBuf.h
|
|
||||||
src/base/net/tools/Storage.h
|
|
||||||
src/base/tools/Arguments.h
|
|
||||||
src/base/tools/Buffer.h
|
|
||||||
src/base/tools/Chrono.h
|
|
||||||
src/base/tools/Handle.h
|
|
||||||
src/base/tools/String.h
|
|
||||||
src/common/config/CommonConfig.h
|
src/common/config/CommonConfig.h
|
||||||
src/common/config/ConfigLoader.h
|
src/common/config/ConfigLoader.h
|
||||||
src/common/config/ConfigWatcher.h
|
src/common/config/ConfigWatcher.h
|
||||||
src/common/Console.h
|
|
||||||
src/common/cpu/Cpu.h
|
src/common/cpu/Cpu.h
|
||||||
src/common/crypto/Algorithm.h
|
src/common/crypto/Algorithm.h
|
||||||
src/common/crypto/keccak.h
|
src/common/crypto/keccak.h
|
||||||
src/common/interfaces/IConfig.h
|
src/common/interfaces/IConfig.h
|
||||||
src/common/interfaces/IConfigCreator.h
|
src/common/interfaces/IConfigCreator.h
|
||||||
src/common/interfaces/IConsoleListener.h
|
|
||||||
src/common/interfaces/IControllerListener.h
|
src/common/interfaces/IControllerListener.h
|
||||||
src/common/interfaces/ICpuInfo.h
|
src/common/interfaces/ICpuInfo.h
|
||||||
src/common/interfaces/ILogBackend.h
|
src/common/interfaces/ILogBackend.h
|
||||||
|
@ -68,7 +39,6 @@ set(HEADERS
|
||||||
src/common/log/FileLog.h
|
src/common/log/FileLog.h
|
||||||
src/common/log/Log.h
|
src/common/log/Log.h
|
||||||
src/common/Platform.h
|
src/common/Platform.h
|
||||||
src/common/utils/c_str.h
|
|
||||||
src/common/utils/mm_malloc.h
|
src/common/utils/mm_malloc.h
|
||||||
src/common/xmrig.h
|
src/common/xmrig.h
|
||||||
src/core/ConfigLoader_default.h
|
src/core/ConfigLoader_default.h
|
||||||
|
@ -114,28 +84,12 @@ else()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(SOURCES
|
set(SOURCES
|
||||||
|
"${SOURCES_BASE}"
|
||||||
src/api/NetworkState.cpp
|
src/api/NetworkState.cpp
|
||||||
src/App.cpp
|
src/App.cpp
|
||||||
src/base/io/Json.cpp
|
|
||||||
src/base/io/Watcher.cpp
|
|
||||||
src/base/kernel/Entry.cpp
|
|
||||||
src/base/kernel/Process.cpp
|
|
||||||
src/base/kernel/Signals.cpp
|
|
||||||
src/base/net/dns/Dns.cpp
|
|
||||||
src/base/net/dns/DnsRecord.cpp
|
|
||||||
src/base/net/stratum/Client.cpp
|
|
||||||
src/base/net/stratum/Job.cpp
|
|
||||||
src/base/net/stratum/Pool.cpp
|
|
||||||
src/base/net/stratum/Pools.cpp
|
|
||||||
src/base/net/stratum/strategies/FailoverStrategy.cpp
|
|
||||||
src/base/net/stratum/strategies/SinglePoolStrategy.cpp
|
|
||||||
src/base/tools/Arguments.cpp
|
|
||||||
src/base/tools/Buffer.cpp
|
|
||||||
src/base/tools/String.cpp
|
|
||||||
src/common/config/CommonConfig.cpp
|
src/common/config/CommonConfig.cpp
|
||||||
src/common/config/ConfigLoader.cpp
|
src/common/config/ConfigLoader.cpp
|
||||||
src/common/config/ConfigWatcher.cpp
|
src/common/config/ConfigWatcher.cpp
|
||||||
src/common/Console.cpp
|
|
||||||
src/common/crypto/Algorithm.cpp
|
src/common/crypto/Algorithm.cpp
|
||||||
src/common/crypto/keccak.cpp
|
src/common/crypto/keccak.cpp
|
||||||
src/common/log/BasicLog.cpp
|
src/common/log/BasicLog.cpp
|
||||||
|
@ -167,9 +121,9 @@ set(SOURCES_CRYPTO
|
||||||
|
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
set(SOURCES_OS
|
set(SOURCES_OS
|
||||||
|
"${SOURCES_OS}"
|
||||||
res/app.rc
|
res/app.rc
|
||||||
src/App_win.cpp
|
src/App_win.cpp
|
||||||
src/base/io/Json_win.cpp
|
|
||||||
src/common/Platform_win.cpp
|
src/common/Platform_win.cpp
|
||||||
src/Mem_win.cpp
|
src/Mem_win.cpp
|
||||||
)
|
)
|
||||||
|
@ -178,15 +132,15 @@ if (WIN32)
|
||||||
set(EXTRA_LIBS ws2_32 psapi iphlpapi userenv)
|
set(EXTRA_LIBS ws2_32 psapi iphlpapi userenv)
|
||||||
elseif (APPLE)
|
elseif (APPLE)
|
||||||
set(SOURCES_OS
|
set(SOURCES_OS
|
||||||
|
"${SOURCES_OS}"
|
||||||
src/App_unix.cpp
|
src/App_unix.cpp
|
||||||
src/base/io/Json_unix.cpp
|
|
||||||
src/common/Platform_mac.cpp
|
src/common/Platform_mac.cpp
|
||||||
src/Mem_unix.cpp
|
src/Mem_unix.cpp
|
||||||
)
|
)
|
||||||
else()
|
else()
|
||||||
set(SOURCES_OS
|
set(SOURCES_OS
|
||||||
|
"${SOURCES_OS}"
|
||||||
src/App_unix.cpp
|
src/App_unix.cpp
|
||||||
src/base/io/Json_unix.cpp
|
|
||||||
src/common/Platform_unix.cpp
|
src/common/Platform_unix.cpp
|
||||||
src/Mem_unix.cpp
|
src/Mem_unix.cpp
|
||||||
)
|
)
|
||||||
|
|
|
@ -16,9 +16,13 @@ if (WITH_TLS)
|
||||||
else()
|
else()
|
||||||
message(FATAL_ERROR "OpenSSL NOT found: use `-DWITH_TLS=OFF` to build without TLS support")
|
message(FATAL_ERROR "OpenSSL NOT found: use `-DWITH_TLS=OFF` to build without TLS support")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
add_definitions(/DXMRIG_FEATURE_TLS)
|
||||||
|
remove_definitions(/DXMRIG_NO_TLS)
|
||||||
else()
|
else()
|
||||||
set(TLS_SOURCES "")
|
set(TLS_SOURCES "")
|
||||||
set(OPENSSL_LIBRARIES "")
|
set(OPENSSL_LIBRARIES "")
|
||||||
|
remove_definitions(/DXMRIG_FEATURE_TLS)
|
||||||
add_definitions(/DXMRIG_NO_TLS)
|
add_definitions(/DXMRIG_NO_TLS)
|
||||||
|
|
||||||
set(CMAKE_PROJECT_NAME "${CMAKE_PROJECT_NAME}-notls")
|
set(CMAKE_PROJECT_NAME "${CMAKE_PROJECT_NAME}-notls")
|
||||||
|
|
|
@ -30,8 +30,8 @@
|
||||||
|
|
||||||
#include "api/Api.h"
|
#include "api/Api.h"
|
||||||
#include "App.h"
|
#include "App.h"
|
||||||
|
#include "base/io/Console.h"
|
||||||
#include "base/kernel/Signals.h"
|
#include "base/kernel/Signals.h"
|
||||||
#include "common/Console.h"
|
|
||||||
#include "common/cpu/Cpu.h"
|
#include "common/cpu/Cpu.h"
|
||||||
#include "common/log/Log.h"
|
#include "common/log/Log.h"
|
||||||
#include "common/Platform.h"
|
#include "common/Platform.h"
|
||||||
|
|
|
@ -27,8 +27,8 @@
|
||||||
#define XMRIG_APP_H
|
#define XMRIG_APP_H
|
||||||
|
|
||||||
|
|
||||||
|
#include "base/kernel/interfaces/IConsoleListener.h"
|
||||||
#include "base/kernel/interfaces/ISignalListener.h"
|
#include "base/kernel/interfaces/ISignalListener.h"
|
||||||
#include "common/interfaces/IConsoleListener.h"
|
|
||||||
|
|
||||||
|
|
||||||
class Httpd;
|
class Httpd;
|
||||||
|
|
60
src/base/base.cmake
Normal file
60
src/base/base.cmake
Normal file
|
@ -0,0 +1,60 @@
|
||||||
|
set(HEADERS_BASE
|
||||||
|
src/base/io/Console.h
|
||||||
|
src/base/io/Json.h
|
||||||
|
src/base/io/Watcher.h
|
||||||
|
src/base/kernel/Entry.h
|
||||||
|
src/base/kernel/interfaces/IClientListener.h
|
||||||
|
src/base/kernel/interfaces/IConfigListener.h
|
||||||
|
src/base/kernel/interfaces/IConsoleListener.h
|
||||||
|
src/base/kernel/interfaces/IDnsListener.h
|
||||||
|
src/base/kernel/interfaces/ILineListener.h
|
||||||
|
src/base/kernel/interfaces/ISignalListener.h
|
||||||
|
src/base/kernel/interfaces/IStrategy.h
|
||||||
|
src/base/kernel/interfaces/IStrategyListener.h
|
||||||
|
src/base/kernel/interfaces/IWatcherListener.h
|
||||||
|
src/base/kernel/Process.h
|
||||||
|
src/base/kernel/Signals.h
|
||||||
|
src/base/net/dns/Dns.h
|
||||||
|
src/base/net/dns/DnsRecord.h
|
||||||
|
src/base/net/stratum/Client.h
|
||||||
|
src/base/net/stratum/Job.h
|
||||||
|
src/base/net/stratum/Pool.h
|
||||||
|
src/base/net/stratum/Pools.h
|
||||||
|
src/base/net/stratum/strategies/FailoverStrategy.h
|
||||||
|
src/base/net/stratum/strategies/SinglePoolStrategy.h
|
||||||
|
src/base/net/stratum/SubmitResult.h
|
||||||
|
src/base/net/tools/RecvBuf.h
|
||||||
|
src/base/net/tools/Storage.h
|
||||||
|
src/base/tools/Arguments.h
|
||||||
|
src/base/tools/Buffer.h
|
||||||
|
src/base/tools/Chrono.h
|
||||||
|
src/base/tools/Handle.h
|
||||||
|
src/base/tools/String.h
|
||||||
|
)
|
||||||
|
|
||||||
|
set(SOURCES_BASE
|
||||||
|
src/base/io/Console.cpp
|
||||||
|
src/base/io/Json.cpp
|
||||||
|
src/base/io/Watcher.cpp
|
||||||
|
src/base/kernel/Entry.cpp
|
||||||
|
src/base/kernel/Process.cpp
|
||||||
|
src/base/kernel/Signals.cpp
|
||||||
|
src/base/net/dns/Dns.cpp
|
||||||
|
src/base/net/dns/DnsRecord.cpp
|
||||||
|
src/base/net/stratum/Client.cpp
|
||||||
|
src/base/net/stratum/Job.cpp
|
||||||
|
src/base/net/stratum/Pool.cpp
|
||||||
|
src/base/net/stratum/Pools.cpp
|
||||||
|
src/base/net/stratum/strategies/FailoverStrategy.cpp
|
||||||
|
src/base/net/stratum/strategies/SinglePoolStrategy.cpp
|
||||||
|
src/base/tools/Arguments.cpp
|
||||||
|
src/base/tools/Buffer.cpp
|
||||||
|
src/base/tools/String.cpp
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
if (WIN32)
|
||||||
|
set(SOURCES_OS src/base/io/Json_win.cpp)
|
||||||
|
else()
|
||||||
|
set(SOURCES_OS src/base/io/Json_unix.cpp)
|
||||||
|
endif()
|
|
@ -23,9 +23,9 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#include "base/io/Console.h"
|
||||||
|
#include "base/kernel/interfaces/IConsoleListener.h"
|
||||||
#include "base/tools/Handle.h"
|
#include "base/tools/Handle.h"
|
||||||
#include "common/Console.h"
|
|
||||||
#include "interfaces/IConsoleListener.h"
|
|
||||||
|
|
||||||
|
|
||||||
xmrig::Console::Console(IConsoleListener *listener)
|
xmrig::Console::Console(IConsoleListener *listener)
|
|
@ -1,39 +0,0 @@
|
||||||
/* XMRig
|
|
||||||
* Copyright 2010 Jeff Garzik <jgarzik@pobox.com>
|
|
||||||
* Copyright 2012-2014 pooler <pooler@litecoinpool.org>
|
|
||||||
* Copyright 2014 Lucas Jones <https://github.com/lucasjones>
|
|
||||||
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
|
||||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
|
||||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
|
||||||
* Copyright 2016-2018 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef XMRIG_C_STR_H
|
|
||||||
#define XMRIG_C_STR_H
|
|
||||||
|
|
||||||
|
|
||||||
#include "base/tools/String.h"
|
|
||||||
|
|
||||||
|
|
||||||
namespace xmrig {
|
|
||||||
|
|
||||||
|
|
||||||
typedef String c_str;
|
|
||||||
|
|
||||||
|
|
||||||
} /* namespace xmrig */
|
|
||||||
|
|
||||||
#endif /* XMRIG_C_STR_H */
|
|
|
@ -1,55 +0,0 @@
|
||||||
/* XMRig
|
|
||||||
* Copyright 2010 Jeff Garzik <jgarzik@pobox.com>
|
|
||||||
* Copyright 2012-2014 pooler <pooler@litecoinpool.org>
|
|
||||||
* Copyright 2014 Lucas Jones <https://github.com/lucasjones>
|
|
||||||
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
|
||||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
|
||||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
|
||||||
* Copyright 2016-2018 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef XMRIG_TIMESTAMP_H
|
|
||||||
#define XMRIG_TIMESTAMP_H
|
|
||||||
|
|
||||||
|
|
||||||
#include <chrono>
|
|
||||||
|
|
||||||
|
|
||||||
namespace xmrig {
|
|
||||||
|
|
||||||
|
|
||||||
static inline int64_t steadyTimestamp()
|
|
||||||
{
|
|
||||||
using namespace std::chrono;
|
|
||||||
if (high_resolution_clock::is_steady) {
|
|
||||||
return time_point_cast<milliseconds>(high_resolution_clock::now()).time_since_epoch().count();
|
|
||||||
}
|
|
||||||
|
|
||||||
return time_point_cast<milliseconds>(steady_clock::now()).time_since_epoch().count();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static inline int64_t currentMSecsSinceEpoch()
|
|
||||||
{
|
|
||||||
using namespace std::chrono;
|
|
||||||
|
|
||||||
return time_point_cast<milliseconds>(high_resolution_clock::now()).time_since_epoch().count();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
} /* namespace xmrig */
|
|
||||||
|
|
||||||
#endif /* XMRIG_TIMESTAMP_H */
|
|
Loading…
Reference in a new issue