
* can build without microhttpd when WITH_HTTPD=OFF * #341 Fix wrong exit code. * +15% boost with non-AES CPU Performance boost validated on Core 2 Quad processor under Windows 10. But it's Windows/MS Visual C++ specific. * #341 Added option --dry-run. * Remove compilation warnings under MSVC * up to 20% perf increase with Cryptonight with non-AES CPU This time, the performance increase is got with MSVC and GCC. On non-AES CPU, there were an useless load/store SSE2 register. The last MSVC "hack" is replaced by a portable code and he's more complete (a load is saved). On my C2Q6600, with 3 thread, I have +16% with MSVC2015 and +20% with GCC 7.3, compared to official 2.4.4 version. * Compilation error under FreeBSD ULONG is not recognized under this OS, so replaced it with more portable definition. * Update README.md * Update README.md * Update README.md * Correct L2 cache size calculation for Intel Core 2 family This is a workaround for total L2 cache size calculation of Intel Core Solo, Core Duo, Core 2 Duo, Core 2 Quad and their Xeon homologue. These processors have L2 cache shared by 2 cores. There is maybe more CPU with L2 shared cache, but I am sure that these models are concerned and they are not so numerous. A better way would be to modify libcpuid to implement L2 cache counting. * Fix code style, replace tabs to space. * Fix code style, replace tabs to space #2. * Update README.md * Update CHANGELOG.md * Update README.md * Update README.md * v2.4.5 RC * Update CHANGELOG.md * Run internal http server in main loop to avoid requirement to thread synchronization. * Added XMRIG_DEPS cmake variable for unified dependencies. * Use adaptive timer instead of idle handler for HTTP server. * Changes for the Monero v1 PoW * #428 Fixed regression with CPU cache size detection. * Fixed regression (all versions since 2.4 affected) fragmented responses from pool/proxy parsed incorrectly. * Update copyright and move version into Job class. * PoW changes WIP * Added reference hashes. * Added full IPv6 support. * Added option to disable Monero v7 PoW, may useful in future if other coins update their network to v7 without PoW change. * Automatically enable nicehash when use with upcoming xmrig-proxy 2.5. * Added coin field support added in xmrig-proxy 2.5. * Update CHANGELOG.md * Update CHANGELOG.md * Revert changes in Api class, single threaded http server will not be included in 2.5 release. * v2.5.0-dev * Change donation address to separate old and new versions. * Some small fixes. * Better v1 PoW implementation, added variant option. * Added test hashes for AEON. * Change port for AEON donate. * Add -DBUILD_STATIC=ON for static builds See #238 * Simplify variant selection. * #438 Fixed memory release. * Fix for previous commit. * Fix FindUV.cmake and FindMHD.cmake. * Fixes for 32 bit gcc builds. * Remove align.h. * Fix. * Fix FindMHD.cmake * Fix macOS compile. * v2.5.0 * Update README.md * Update README.md
214 lines
5.1 KiB
CMake
214 lines
5.1 KiB
CMake
cmake_minimum_required(VERSION 2.8)
|
|
project(xmrig)
|
|
|
|
option(WITH_LIBCPUID "Use Libcpuid" ON)
|
|
option(WITH_AEON "CryptoNight-Lite support" ON)
|
|
option(WITH_HTTPD "HTTP REST API" ON)
|
|
option(BUILD_STATIC "Build static binary" OFF)
|
|
|
|
include (CheckIncludeFile)
|
|
include (cmake/cpu.cmake)
|
|
|
|
|
|
set(HEADERS
|
|
src/api/Api.h
|
|
src/api/ApiState.h
|
|
src/api/NetworkState.h
|
|
src/App.h
|
|
src/Console.h
|
|
src/Cpu.h
|
|
src/interfaces/IClientListener.h
|
|
src/interfaces/IConsoleListener.h
|
|
src/interfaces/IJobResultListener.h
|
|
src/interfaces/ILogBackend.h
|
|
src/interfaces/IStrategy.h
|
|
src/interfaces/IStrategyListener.h
|
|
src/interfaces/IWorker.h
|
|
src/log/ConsoleLog.h
|
|
src/log/FileLog.h
|
|
src/log/Log.h
|
|
src/Mem.h
|
|
src/net/Client.h
|
|
src/net/Id.h
|
|
src/net/Job.h
|
|
src/net/JobResult.h
|
|
src/net/Network.h
|
|
src/net/strategies/DonateStrategy.h
|
|
src/net/strategies/FailoverStrategy.h
|
|
src/net/strategies/SinglePoolStrategy.h
|
|
src/net/SubmitResult.h
|
|
src/net/Url.h
|
|
src/Options.h
|
|
src/Platform.h
|
|
src/Summary.h
|
|
src/version.h
|
|
src/workers/DoubleWorker.h
|
|
src/workers/Handle.h
|
|
src/workers/Hashrate.h
|
|
src/workers/SingleWorker.h
|
|
src/workers/Worker.h
|
|
src/workers/Workers.h
|
|
src/xmrig.h
|
|
)
|
|
|
|
set(HEADERS_CRYPTO
|
|
src/crypto/c_blake256.h
|
|
src/crypto/c_groestl.h
|
|
src/crypto/c_jh.h
|
|
src/crypto/c_keccak.h
|
|
src/crypto/c_skein.h
|
|
src/crypto/CryptoNight.h
|
|
src/crypto/CryptoNight_monero.h
|
|
src/crypto/CryptoNight_test.h
|
|
src/crypto/groestl_tables.h
|
|
src/crypto/hash.h
|
|
src/crypto/skein_port.h
|
|
src/crypto/soft_aes.h
|
|
)
|
|
|
|
if (XMRIG_ARM)
|
|
set(HEADERS_CRYPTO "${HEADERS_CRYPTO}" src/crypto/CryptoNight_arm.h)
|
|
else()
|
|
set(HEADERS_CRYPTO "${HEADERS_CRYPTO}" src/crypto/CryptoNight_x86.h)
|
|
endif()
|
|
|
|
set(SOURCES
|
|
src/api/Api.cpp
|
|
src/api/ApiState.cpp
|
|
src/api/NetworkState.cpp
|
|
src/App.cpp
|
|
src/Console.cpp
|
|
src/log/ConsoleLog.cpp
|
|
src/log/FileLog.cpp
|
|
src/log/Log.cpp
|
|
src/Mem.cpp
|
|
src/net/Client.cpp
|
|
src/net/Job.cpp
|
|
src/net/Network.cpp
|
|
src/net/strategies/DonateStrategy.cpp
|
|
src/net/strategies/FailoverStrategy.cpp
|
|
src/net/strategies/SinglePoolStrategy.cpp
|
|
src/net/SubmitResult.cpp
|
|
src/net/Url.cpp
|
|
src/Options.cpp
|
|
src/Platform.cpp
|
|
src/Summary.cpp
|
|
src/workers/DoubleWorker.cpp
|
|
src/workers/Handle.cpp
|
|
src/workers/Hashrate.cpp
|
|
src/workers/SingleWorker.cpp
|
|
src/workers/Worker.cpp
|
|
src/workers/Workers.cpp
|
|
src/xmrig.cpp
|
|
)
|
|
|
|
set(SOURCES_CRYPTO
|
|
src/crypto/c_keccak.c
|
|
src/crypto/c_groestl.c
|
|
src/crypto/c_blake256.c
|
|
src/crypto/c_jh.c
|
|
src/crypto/c_skein.c
|
|
src/crypto/CryptoNight.cpp
|
|
)
|
|
|
|
if (WIN32)
|
|
set(SOURCES_OS
|
|
res/app.rc
|
|
src/App_win.cpp
|
|
src/Cpu_win.cpp
|
|
src/Mem_win.cpp
|
|
src/Platform_win.cpp
|
|
)
|
|
|
|
add_definitions(/DWIN32)
|
|
set(EXTRA_LIBS ws2_32 psapi iphlpapi userenv)
|
|
elseif (APPLE)
|
|
set(SOURCES_OS
|
|
src/App_unix.cpp
|
|
src/Cpu_mac.cpp
|
|
src/Mem_unix.cpp
|
|
src/Platform_mac.cpp
|
|
)
|
|
else()
|
|
set(SOURCES_OS
|
|
src/App_unix.cpp
|
|
src/Cpu_unix.cpp
|
|
src/Mem_unix.cpp
|
|
src/Platform_unix.cpp
|
|
)
|
|
|
|
set(EXTRA_LIBS pthread rt)
|
|
endif()
|
|
|
|
if (CMAKE_SYSTEM_NAME STREQUAL FreeBSD)
|
|
set(EXTRA_LIBS ${EXTRA_LIBS} kvm)
|
|
endif()
|
|
|
|
if (CMAKE_SYSTEM_NAME MATCHES "Linux")
|
|
EXECUTE_PROCESS(COMMAND uname -o COMMAND tr -d '\n' OUTPUT_VARIABLE OPERATING_SYSTEM)
|
|
if (OPERATING_SYSTEM MATCHES "Android")
|
|
set(EXTRA_LIBS ${EXTRA_LIBS} log)
|
|
endif()
|
|
endif()
|
|
|
|
add_definitions(/D__STDC_FORMAT_MACROS)
|
|
add_definitions(/DUNICODE)
|
|
#add_definitions(/DAPP_DEBUG)
|
|
|
|
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake")
|
|
|
|
find_package(UV REQUIRED)
|
|
|
|
include(cmake/flags.cmake)
|
|
|
|
if (WITH_LIBCPUID)
|
|
add_subdirectory(src/3rdparty/libcpuid)
|
|
|
|
include_directories(src/3rdparty/libcpuid)
|
|
set(CPUID_LIB cpuid)
|
|
set(SOURCES_CPUID src/Cpu.cpp)
|
|
else()
|
|
add_definitions(/DXMRIG_NO_LIBCPUID)
|
|
|
|
if (XMRIG_ARM)
|
|
set(SOURCES_CPUID src/Cpu_arm.cpp)
|
|
else()
|
|
set(SOURCES_CPUID src/Cpu_stub.cpp)
|
|
endif()
|
|
endif()
|
|
|
|
CHECK_INCLUDE_FILE (syslog.h HAVE_SYSLOG_H)
|
|
if (HAVE_SYSLOG_H)
|
|
add_definitions(/DHAVE_SYSLOG_H)
|
|
set(SOURCES_SYSLOG src/log/SysLog.h src/log/SysLog.cpp)
|
|
endif()
|
|
|
|
if (NOT WITH_AEON)
|
|
add_definitions(/DXMRIG_NO_AEON)
|
|
endif()
|
|
|
|
if (WITH_HTTPD)
|
|
find_package(MHD)
|
|
|
|
if (MHD_FOUND)
|
|
include_directories(${MHD_INCLUDE_DIRS})
|
|
set(HTTPD_SOURCES src/api/Httpd.h src/api/Httpd.cpp)
|
|
else()
|
|
message(FATAL_ERROR "microhttpd NOT found: use `-DWITH_HTTPD=OFF` to build without http deamon support")
|
|
endif()
|
|
else()
|
|
set(MHD_LIBRARY "")
|
|
add_definitions(/DXMRIG_NO_HTTPD)
|
|
add_definitions(/DXMRIG_NO_API)
|
|
endif()
|
|
|
|
include_directories(src)
|
|
include_directories(src/3rdparty)
|
|
include_directories(${UV_INCLUDE_DIR})
|
|
|
|
if (BUILD_STATIC)
|
|
set(CMAKE_EXE_LINKER_FLAGS " -static")
|
|
endif()
|
|
|
|
add_executable(xmrig ${HEADERS} ${SOURCES} ${SOURCES_OS} ${SOURCES_CPUID} ${HEADERS_CRYPTO} ${SOURCES_CRYPTO} ${SOURCES_SYSLOG} ${HTTPD_SOURCES})
|
|
target_link_libraries(xmrig ${UV_LIBRARIES} ${MHD_LIBRARY} ${EXTRA_LIBS} ${CPUID_LIB})
|