mirror of
https://github.com/xmrig/xmrig.git
synced 2024-12-23 03:59:41 +00:00
Sync changes.
This commit is contained in:
parent
a76243a65e
commit
9f6f599d78
8 changed files with 32 additions and 8 deletions
|
@ -257,5 +257,5 @@ if (WITH_DEBUG_LOG)
|
||||||
add_definitions(/DAPP_DEBUG)
|
add_definitions(/DAPP_DEBUG)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_executable(${PROJECT_NAME} ${HEADERS} ${SOURCES} ${SOURCES_OS} ${SOURCES_CPUID} ${HEADERS_CRYPTO} ${SOURCES_CRYPTO} ${SOURCES_SYSLOG} ${HTTPD_SOURCES} ${TLS_SOURCES} ${XMRIG_ASM_SOURCES})
|
add_executable(${CMAKE_PROJECT_NAME} ${HEADERS} ${SOURCES} ${SOURCES_OS} ${SOURCES_CPUID} ${HEADERS_CRYPTO} ${SOURCES_CRYPTO} ${SOURCES_SYSLOG} ${HTTPD_SOURCES} ${TLS_SOURCES} ${XMRIG_ASM_SOURCES})
|
||||||
target_link_libraries(${PROJECT_NAME} ${XMRIG_ASM_LIBRARY} ${OPENSSL_LIBRARIES} ${UV_LIBRARIES} ${MHD_LIBRARY} ${EXTRA_LIBS} ${CPUID_LIB})
|
target_link_libraries(${CMAKE_PROJECT_NAME} ${XMRIG_ASM_LIBRARY} ${OPENSSL_LIBRARIES} ${UV_LIBRARIES} ${MHD_LIBRARY} ${EXTRA_LIBS} ${CPUID_LIB})
|
||||||
|
|
|
@ -20,4 +20,6 @@ else()
|
||||||
set(TLS_SOURCES "")
|
set(TLS_SOURCES "")
|
||||||
set(OPENSSL_LIBRARIES "")
|
set(OPENSSL_LIBRARIES "")
|
||||||
add_definitions(/DXMRIG_NO_TLS)
|
add_definitions(/DXMRIG_NO_TLS)
|
||||||
|
|
||||||
|
set(CMAKE_PROJECT_NAME "${CMAKE_PROJECT_NAME}-notls")
|
||||||
endif()
|
endif()
|
||||||
|
|
|
@ -87,6 +87,10 @@ App::~App()
|
||||||
|
|
||||||
int App::exec()
|
int App::exec()
|
||||||
{
|
{
|
||||||
|
if (m_controller->isDone()) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
if (!m_controller->isReady()) {
|
if (!m_controller->isReady()) {
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
|
|
@ -174,8 +174,11 @@ void xmrig::CommonConfig::printVersions()
|
||||||
int length = snprintf(buf, sizeof buf, "CUDA/%d.%d ", cudaVersion / 1000, cudaVersion % 100);
|
int length = snprintf(buf, sizeof buf, "CUDA/%d.%d ", cudaVersion / 1000, cudaVersion % 100);
|
||||||
# else
|
# else
|
||||||
memset(buf, 0, 16);
|
memset(buf, 0, 16);
|
||||||
|
|
||||||
|
# if !defined(XMRIG_NO_HTTPD) || !defined(XMRIG_NO_TLS)
|
||||||
int length = 0;
|
int length = 0;
|
||||||
# endif
|
# endif
|
||||||
|
# endif
|
||||||
|
|
||||||
# if !defined(XMRIG_NO_TLS) && defined(OPENSSL_VERSION_TEXT)
|
# if !defined(XMRIG_NO_TLS) && defined(OPENSSL_VERSION_TEXT)
|
||||||
{
|
{
|
||||||
|
|
|
@ -50,6 +50,7 @@
|
||||||
#include "rapidjson/filereadstream.h"
|
#include "rapidjson/filereadstream.h"
|
||||||
|
|
||||||
|
|
||||||
|
bool xmrig::ConfigLoader::m_done = false;
|
||||||
xmrig::ConfigWatcher *xmrig::ConfigLoader::m_watcher = nullptr;
|
xmrig::ConfigWatcher *xmrig::ConfigLoader::m_watcher = nullptr;
|
||||||
xmrig::IConfigCreator *xmrig::ConfigLoader::m_creator = nullptr;
|
xmrig::IConfigCreator *xmrig::ConfigLoader::m_creator = nullptr;
|
||||||
xmrig::IWatcherListener *xmrig::ConfigLoader::m_listener = nullptr;
|
xmrig::IWatcherListener *xmrig::ConfigLoader::m_listener = nullptr;
|
||||||
|
@ -283,12 +284,16 @@ void xmrig::ConfigLoader::parseJSON(xmrig::IConfig *config, const struct option
|
||||||
|
|
||||||
void xmrig::ConfigLoader::showUsage()
|
void xmrig::ConfigLoader::showUsage()
|
||||||
{
|
{
|
||||||
|
m_done = true;
|
||||||
|
|
||||||
printf(usage);
|
printf(usage);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void xmrig::ConfigLoader::showVersion()
|
void xmrig::ConfigLoader::showVersion()
|
||||||
{
|
{
|
||||||
|
m_done = true;
|
||||||
|
|
||||||
printf(APP_NAME " " APP_VERSION "\n built on " __DATE__
|
printf(APP_NAME " " APP_VERSION "\n built on " __DATE__
|
||||||
|
|
||||||
# if defined(__clang__)
|
# if defined(__clang__)
|
||||||
|
|
|
@ -21,8 +21,8 @@
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __CONFIGLOADER_H__
|
#ifndef XMRIG_CONFIGLOADER_H
|
||||||
#define __CONFIGLOADER_H__
|
#define XMRIG_CONFIGLOADER_H
|
||||||
|
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
@ -53,6 +53,8 @@ public:
|
||||||
static IConfig *load(int argc, char **argv, IConfigCreator *creator, IWatcherListener *listener);
|
static IConfig *load(int argc, char **argv, IConfigCreator *creator, IWatcherListener *listener);
|
||||||
static void release();
|
static void release();
|
||||||
|
|
||||||
|
static inline bool isDone() { return m_done; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static bool getJSON(const char *fileName, rapidjson::Document &doc);
|
static bool getJSON(const char *fileName, rapidjson::Document &doc);
|
||||||
static bool parseArg(IConfig *config, int key, const char *arg);
|
static bool parseArg(IConfig *config, int key, const char *arg);
|
||||||
|
@ -60,6 +62,7 @@ private:
|
||||||
static void showUsage();
|
static void showUsage();
|
||||||
static void showVersion();
|
static void showVersion();
|
||||||
|
|
||||||
|
static bool m_done;
|
||||||
static ConfigWatcher *m_watcher;
|
static ConfigWatcher *m_watcher;
|
||||||
static IConfigCreator *m_creator;
|
static IConfigCreator *m_creator;
|
||||||
static IWatcherListener *m_listener;
|
static IWatcherListener *m_listener;
|
||||||
|
@ -68,4 +71,4 @@ private:
|
||||||
|
|
||||||
} /* namespace xmrig */
|
} /* namespace xmrig */
|
||||||
|
|
||||||
#endif /* __CONFIGLOADER_H__ */
|
#endif /* XMRIG_CONFIGLOADER_H */
|
||||||
|
|
|
@ -78,6 +78,12 @@ xmrig::Controller::~Controller()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool xmrig::Controller::isDone() const
|
||||||
|
{
|
||||||
|
return ConfigLoader::isDone();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool xmrig::Controller::isReady() const
|
bool xmrig::Controller::isReady() const
|
||||||
{
|
{
|
||||||
return d_ptr->config && d_ptr->network;
|
return d_ptr->config && d_ptr->network;
|
||||||
|
|
|
@ -21,8 +21,8 @@
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __CONTROLLER_H__
|
#ifndef XMRIG_CONTROLLER_H
|
||||||
#define __CONTROLLER_H__
|
#define XMRIG_CONTROLLER_H
|
||||||
|
|
||||||
|
|
||||||
#include "common/interfaces/IWatcherListener.h"
|
#include "common/interfaces/IWatcherListener.h"
|
||||||
|
@ -46,6 +46,7 @@ public:
|
||||||
Controller();
|
Controller();
|
||||||
~Controller();
|
~Controller();
|
||||||
|
|
||||||
|
bool isDone() const;
|
||||||
bool isReady() const;
|
bool isReady() const;
|
||||||
Config *config() const;
|
Config *config() const;
|
||||||
int init(int argc, char **argv);
|
int init(int argc, char **argv);
|
||||||
|
@ -61,4 +62,4 @@ private:
|
||||||
|
|
||||||
} /* namespace xmrig */
|
} /* namespace xmrig */
|
||||||
|
|
||||||
#endif /* __CONTROLLER_H__ */
|
#endif /* XMRIG_CONTROLLER_H */
|
||||||
|
|
Loading…
Reference in a new issue