Update for new Entry class.
This commit is contained in:
parent
26819f01e1
commit
d7a6aaadea
@ -20,7 +20,7 @@ VS_VERSION_INFO VERSIONINFO
|
||||
BEGIN
|
||||
BLOCK "000004b0"
|
||||
BEGIN
|
||||
VALUE "CompanyName", APP_SITE
|
||||
VALUE "CompanyName", APP_DOMAIN
|
||||
VALUE "FileDescription", APP_DESC
|
||||
VALUE "FileVersion", APP_VERSION
|
||||
VALUE "LegalCopyright", APP_COPYRIGHT
|
||||
|
@ -1,12 +1,6 @@
|
||||
/* 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 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
* Copyright (c) 2018-2021 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright (c) 2016-2021 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
|
||||
@ -22,10 +16,28 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
#include "backend/opencl/wrappers/OclPlatform.h"
|
||||
#include "3rdparty/rapidjson/document.h"
|
||||
#include "backend/opencl/wrappers/OclLib.h"
|
||||
#include "base/kernel/Process.h"
|
||||
#include "base/tools/Arguments.h"
|
||||
|
||||
|
||||
bool xmrig::OclPlatform::printPlatforms(int &rc)
|
||||
{
|
||||
if (Process::arguments().contains("--print-platforms")) {
|
||||
if (OclLib::init()) {
|
||||
OclPlatform::print();
|
||||
}
|
||||
else {
|
||||
rc = 1;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
std::vector<xmrig::OclPlatform> xmrig::OclPlatform::get()
|
||||
|
@ -1,12 +1,6 @@
|
||||
/* 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 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
* Copyright (c) 2018-2021 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright (c) 2016-2021 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
|
||||
@ -45,6 +39,7 @@ public:
|
||||
OclPlatform() = default;
|
||||
OclPlatform(size_t index, cl_platform_id id) : m_id(id), m_index(index) {}
|
||||
|
||||
static bool printPlatforms(int &rc);
|
||||
static std::vector<OclPlatform> get();
|
||||
static void print();
|
||||
|
||||
|
2
src/base
2
src/base
@ -1 +1 @@
|
||||
Subproject commit 8cd9a654debe3c9b6b46ef65c538c04325c4c509
|
||||
Subproject commit eecf97769a019ef2266e51b5ca2172a1834eef78
|
@ -25,16 +25,13 @@
|
||||
#define XMRIG_USAGE_H
|
||||
|
||||
|
||||
#include "../version.h"
|
||||
|
||||
|
||||
#include <string>
|
||||
|
||||
|
||||
namespace xmrig {
|
||||
|
||||
|
||||
static inline const std::string &usage()
|
||||
static const std::string &usage()
|
||||
{
|
||||
static std::string u;
|
||||
|
||||
@ -42,7 +39,7 @@ static inline const std::string &usage()
|
||||
return u;
|
||||
}
|
||||
|
||||
u += "Usage: " APP_ID " [OPTIONS]\n\nNetwork:\n";
|
||||
u += "\nNetwork:\n";
|
||||
u += " -o, --url=URL URL of mining server\n";
|
||||
u += " -a, --algo=ALGO mining algorithm https://xmrig.com/docs/algorithms\n";
|
||||
u += " --coin=COIN specify coin instead of algorithm\n";
|
||||
@ -174,14 +171,8 @@ static inline const std::string &usage()
|
||||
|
||||
u += " -c, --config=FILE load a JSON-format configuration file\n";
|
||||
u += " -B, --background run the miner in the background\n";
|
||||
u += " -V, --version output version information and exit\n";
|
||||
u += " -h, --help display this help and exit\n";
|
||||
u += " --dry-run test configuration and exit\n";
|
||||
|
||||
# ifdef XMRIG_FEATURE_HWLOC
|
||||
u += " --export-topology export hwloc topology to a XML file and exit\n";
|
||||
# endif
|
||||
|
||||
# ifdef XMRIG_OS_WIN
|
||||
u += " --title set custom console window title\n";
|
||||
u += " --no-title disable setting console window title\n";
|
||||
|
@ -22,32 +22,12 @@
|
||||
#define APP_ID "xmrig"
|
||||
#define APP_NAME "XMRig"
|
||||
#define APP_DESC "XMRig miner"
|
||||
#define APP_VERSION "6.15.0-dev"
|
||||
#define APP_DOMAIN "xmrig.com"
|
||||
#define APP_SITE "www.xmrig.com"
|
||||
#define APP_COPYRIGHT "Copyright (C) 2016-2021 xmrig.com"
|
||||
#define APP_KIND "miner"
|
||||
|
||||
#define APP_VER_MAJOR 6
|
||||
#define APP_VER_MINOR 15
|
||||
#define APP_VER_MINOR 99
|
||||
#define APP_VER_PATCH 0
|
||||
|
||||
#ifdef _MSC_VER
|
||||
# if (_MSC_VER >= 1920)
|
||||
# define MSVC_VERSION 2019
|
||||
# elif (_MSC_VER >= 1910 && _MSC_VER < 1920)
|
||||
# define MSVC_VERSION 2017
|
||||
# elif _MSC_VER == 1900
|
||||
# define MSVC_VERSION 2015
|
||||
# elif _MSC_VER == 1800
|
||||
# define MSVC_VERSION 2013
|
||||
# elif _MSC_VER == 1700
|
||||
# define MSVC_VERSION 2012
|
||||
# elif _MSC_VER == 1600
|
||||
# define MSVC_VERSION 2010
|
||||
# else
|
||||
# define MSVC_VERSION 0
|
||||
# endif
|
||||
#endif
|
||||
#include "base/kernel/base-version.h"
|
||||
|
||||
#endif /* XMRIG_VERSION_H */
|
||||
|
@ -19,6 +19,12 @@
|
||||
#include "App.h"
|
||||
#include "base/kernel/Entry.h"
|
||||
#include "base/kernel/Process.h"
|
||||
#include "core/config/usage.h"
|
||||
|
||||
|
||||
#ifdef XMRIG_FEATURE_OPENCL
|
||||
# include "backend/opencl/wrappers/OclPlatform.h"
|
||||
#endif
|
||||
|
||||
|
||||
int main(int argc, char **argv)
|
||||
@ -26,9 +32,18 @@ int main(int argc, char **argv)
|
||||
using namespace xmrig;
|
||||
|
||||
Process process(argc, argv);
|
||||
const auto entry = Entry::get();
|
||||
if (entry) {
|
||||
return Entry::exec(entry);
|
||||
|
||||
{
|
||||
int rc = 0;
|
||||
auto entry = std::make_unique<Entry>(usage);
|
||||
|
||||
# ifdef XMRIG_FEATURE_OPENCL
|
||||
entry->add(OclPlatform::printPlatforms);
|
||||
# endif
|
||||
|
||||
if (entry->exec(rc)) {
|
||||
return rc;
|
||||
}
|
||||
}
|
||||
|
||||
App app;
|
||||
|
Loading…
x
Reference in New Issue
Block a user