Update for new Entry class.

This commit is contained in:
XMRig 2021-09-03 23:34:53 +07:00
parent 26819f01e1
commit d7a6aaadea
No known key found for this signature in database
GPG key ID: 446A53638BE94409
7 changed files with 48 additions and 55 deletions

View file

@ -20,7 +20,7 @@ VS_VERSION_INFO VERSIONINFO
BEGIN BEGIN
BLOCK "000004b0" BLOCK "000004b0"
BEGIN BEGIN
VALUE "CompanyName", APP_SITE VALUE "CompanyName", APP_DOMAIN
VALUE "FileDescription", APP_DESC VALUE "FileDescription", APP_DESC
VALUE "FileVersion", APP_VERSION VALUE "FileVersion", APP_VERSION
VALUE "LegalCopyright", APP_COPYRIGHT VALUE "LegalCopyright", APP_COPYRIGHT

View file

@ -1,12 +1,6 @@
/* XMRig /* XMRig
* Copyright 2010 Jeff Garzik <jgarzik@pobox.com> * Copyright (c) 2018-2021 SChernykh <https://github.com/SChernykh>
* Copyright 2012-2014 pooler <pooler@litecoinpool.org> * Copyright (c) 2016-2021 XMRig <https://github.com/xmrig>, <support@xmrig.com>
* 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>
* *
* This program is free software: you can redistribute it and/or modify * 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 * 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/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "backend/opencl/wrappers/OclPlatform.h" #include "backend/opencl/wrappers/OclPlatform.h"
#include "3rdparty/rapidjson/document.h" #include "3rdparty/rapidjson/document.h"
#include "backend/opencl/wrappers/OclLib.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() std::vector<xmrig::OclPlatform> xmrig::OclPlatform::get()

View file

@ -1,12 +1,6 @@
/* XMRig /* XMRig
* Copyright 2010 Jeff Garzik <jgarzik@pobox.com> * Copyright (c) 2018-2021 SChernykh <https://github.com/SChernykh>
* Copyright 2012-2014 pooler <pooler@litecoinpool.org> * Copyright (c) 2016-2021 XMRig <https://github.com/xmrig>, <support@xmrig.com>
* 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>
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -45,6 +39,7 @@ public:
OclPlatform() = default; OclPlatform() = default;
OclPlatform(size_t index, cl_platform_id id) : m_id(id), m_index(index) {} 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 std::vector<OclPlatform> get();
static void print(); static void print();

@ -1 +1 @@
Subproject commit 8cd9a654debe3c9b6b46ef65c538c04325c4c509 Subproject commit eecf97769a019ef2266e51b5ca2172a1834eef78

View file

@ -25,16 +25,13 @@
#define XMRIG_USAGE_H #define XMRIG_USAGE_H
#include "../version.h"
#include <string> #include <string>
namespace xmrig { namespace xmrig {
static inline const std::string &usage() static const std::string &usage()
{ {
static std::string u; static std::string u;
@ -42,7 +39,7 @@ static inline const std::string &usage()
return u; return u;
} }
u += "Usage: " APP_ID " [OPTIONS]\n\nNetwork:\n"; u += "\nNetwork:\n";
u += " -o, --url=URL URL of mining server\n"; u += " -o, --url=URL URL of mining server\n";
u += " -a, --algo=ALGO mining algorithm https://xmrig.com/docs/algorithms\n"; u += " -a, --algo=ALGO mining algorithm https://xmrig.com/docs/algorithms\n";
u += " --coin=COIN specify coin instead of algorithm\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 += " -c, --config=FILE load a JSON-format configuration file\n";
u += " -B, --background run the miner in the background\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"; 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 # ifdef XMRIG_OS_WIN
u += " --title set custom console window title\n"; u += " --title set custom console window title\n";
u += " --no-title disable setting console window title\n"; u += " --no-title disable setting console window title\n";

View file

@ -22,32 +22,12 @@
#define APP_ID "xmrig" #define APP_ID "xmrig"
#define APP_NAME "XMRig" #define APP_NAME "XMRig"
#define APP_DESC "XMRig miner" #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_KIND "miner"
#define APP_VER_MAJOR 6 #define APP_VER_MAJOR 6
#define APP_VER_MINOR 15 #define APP_VER_MINOR 99
#define APP_VER_PATCH 0 #define APP_VER_PATCH 0
#ifdef _MSC_VER #include "base/kernel/base-version.h"
# 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
#endif /* XMRIG_VERSION_H */ #endif /* XMRIG_VERSION_H */

View file

@ -19,6 +19,12 @@
#include "App.h" #include "App.h"
#include "base/kernel/Entry.h" #include "base/kernel/Entry.h"
#include "base/kernel/Process.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) int main(int argc, char **argv)
@ -26,9 +32,18 @@ int main(int argc, char **argv)
using namespace xmrig; using namespace xmrig;
Process process(argc, argv); 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; App app;