From 4928b6d3e3d4cfd5fef62e5e8219d19e83386a9b Mon Sep 17 00:00:00 2001 From: XMRig Date: Sat, 2 Sep 2017 19:04:40 +0300 Subject: [PATCH] Sync changes with xmrig-nvidia --- CMakeLists.txt | 6 +++++- cmake/FindMHD.cmake | 2 +- src/Options.cpp | 20 ++++++++++---------- 3 files changed, 16 insertions(+), 12 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c6a291f6..3f87f92d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -198,7 +198,11 @@ if (HAVE_SYSLOG_H) set(SOURCES_SYSLOG src/log/SysLog.h src/log/SysLog.cpp) endif() -find_package(MHD REQUIRED) +if (NOT WITH_AEON) + add_definitions(/DXMRIG_NO_AEON) +endif() + +find_package(MHD) if (WITH_HTTPD AND MHD_FOUND) include_directories(${MHD_INCLUDE_DIRS}) diff --git a/cmake/FindMHD.cmake b/cmake/FindMHD.cmake index f6665892..8505b337 100644 --- a/cmake/FindMHD.cmake +++ b/cmake/FindMHD.cmake @@ -24,7 +24,7 @@ set(MHD_LIBRARIES ${MHD_LIBRARY}) # same naming convention as in qt (appending debug library with d) # boost is using the same "hack" as us with "optimized" and "debug" # official MHD project actually uses _d suffix -if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL MSVC) +if (${CMAKE_CXX_COMPILER_ID} STREQUAL MSVC) find_library( MHD_LIBRARY_DEBUG NAMES microhttpd_d microhttpd-10_d libmicrohttpd_d libmicrohttpd-dll_d diff --git a/src/Options.cpp b/src/Options.cpp index 120f58bf..d799b83e 100644 --- a/src/Options.cpp +++ b/src/Options.cpp @@ -116,9 +116,9 @@ static struct option const options[] = { { "user-agent", 1, nullptr, 1008 }, { "userpass", 1, nullptr, 'O' }, { "version", 0, nullptr, 'V' }, - { "api-port", 1, nullptr, 3000 }, - { "api-access-token", 1, nullptr, 3001 }, - { "api-worker-id", 1, nullptr, 3002 }, + { "api-port", 1, nullptr, 4000 }, + { "api-access-token", 1, nullptr, 4001 }, + { "api-worker-id", 1, nullptr, 4002 }, { 0, 0, 0, 0 } }; @@ -157,9 +157,9 @@ static struct option const pool_options[] = { static struct option const api_options[] = { - { "port", 1, nullptr, 3000 }, - { "access-token", 1, nullptr, 3001 }, - { "worker-id", 1, nullptr, 3002 }, + { "port", 1, nullptr, 4000 }, + { "access-token", 1, nullptr, 4001 }, + { "worker-id", 1, nullptr, 4002 }, { 0, 0, 0, 0 } }; @@ -316,12 +316,12 @@ bool Options::parseArg(int key, const char *arg) m_colors = false; break; - case 3001: /* --access-token */ + case 4001: /* --access-token */ free(m_apiToken); m_apiToken = strdup(arg); break; - case 3002: /* --worker-id */ + case 4002: /* --worker-id */ free(m_apiWorkerId); m_apiWorkerId = strdup(arg); break; @@ -334,7 +334,7 @@ bool Options::parseArg(int key, const char *arg) case 1004: /* --max-cpu-usage */ case 1007: /* --print-time */ case 1021: /* --cpu-priority */ - case 3000: /* --api-port */ + case 4000: /* --api-port */ return parseArg(key, strtol(arg, nullptr, 10)); case 'B': /* --background */ @@ -457,7 +457,7 @@ bool Options::parseArg(int key, uint64_t arg) } break; - case 3000: /* --api-port */ + case 4000: /* --api-port */ if (arg <= 65536) { m_apiPort = (int) arg; }