Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: papadave66/xmrig
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: rivoreo/xmrig
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 2.8-rivoreo-fork
Choose a head ref
Can’t automatically merge. Don’t worry, you can still create the pull request.

Commits on Mar 22, 2018

  1. Update CHANGELOG.md

    xmrig authored Mar 22, 2018
    Copy the full SHA
    04a95e3 View commit details

Commits on Mar 27, 2018

  1. Merge branch 'master' into dev

    xmrig committed Mar 27, 2018
    Copy the full SHA
    bab6a63 View commit details
  2. Copy the full SHA
    f1bc064 View commit details
  3. Copy the full SHA
    9fe863b View commit details

Commits on Mar 29, 2018

  1. Copy the full SHA
    872148c View commit details

Commits on Mar 31, 2018

  1. Copy the full SHA
    aad19f1 View commit details
  2. Copy the full SHA
    aac7b04 View commit details
  3. Fix Linux build.

    xmrig committed Mar 31, 2018
    Copy the full SHA
    7f5d7cf View commit details
  4. Small fixes.

    xmrig committed Mar 31, 2018
    Copy the full SHA
    af0a6fd View commit details
  5. Copy the full SHA
    341557c View commit details
  6. Copy the full SHA
    8d4d1a3 View commit details
  7. Copy the full SHA
    6e51b41 View commit details
  8. Copy the full SHA
    edd47b1 View commit details
  9. Fix Linux build.

    xmrig committed Mar 31, 2018
    Copy the full SHA
    44d5639 View commit details

Commits on Apr 1, 2018

  1. Copy the full SHA
    a042cbf View commit details

Commits on Apr 2, 2018

  1. Copy the full SHA
    6c97061 View commit details
  2. Now used IThread to start threads, cpu-affinity broken, nonce allocat…

    …ion in double mode probably broken too.
    xmrig committed Apr 2, 2018
    Copy the full SHA
    72cd6d1 View commit details
  3. New style function selector.

    xmrig committed Apr 2, 2018
    Copy the full SHA
    903b243 View commit details
  4. Fix DoubleWorker.

    xmrig committed Apr 2, 2018
    Copy the full SHA
    c1bc6ac View commit details
  5. Copy the full SHA
    d7c5630 View commit details

Commits on Apr 3, 2018

  1. Copy the full SHA
    5c6ec58 View commit details
  2. Copy the full SHA
    7d5a971 View commit details
  3. Copy the full SHA
    dd6bc33 View commit details
  4. Copy the full SHA
    d4123b8 View commit details
  5. Copy the full SHA
    26e1b14 View commit details
  6. Copy the full SHA
    4e8ef7c View commit details
  7. Update CHANGELOG.md

    xmrig authored Apr 3, 2018
    Copy the full SHA
    6b710ff View commit details
  8. Copy the full SHA
    7003559 View commit details
  9. Update README.md

    xmrig authored Apr 3, 2018
    Copy the full SHA
    6a1c52b View commit details
  10. Copy the full SHA
    c227e3c View commit details

Commits on Apr 6, 2018

  1. Small fixes.

    xmrig committed Apr 6, 2018
    Copy the full SHA
    3a67ee6 View commit details
  2. Copy the full SHA
    ae64769 View commit details
  3. Update CHANGELOG.md

    xmrig authored Apr 6, 2018
    Copy the full SHA
    bca087f View commit details
  4. xmrig#499 Disabled IPv6 for internal HTTP API by default, was cause i…

    …ssues on some systems.
    xmrig committed Apr 6, 2018
    Copy the full SHA
    3b83fa5 View commit details
  5. Copy the full SHA
    dff7636 View commit details
  6. Update CHANGELOG.md

    xmrig authored Apr 6, 2018
    Copy the full SHA
    89c095f View commit details

Commits on Apr 7, 2018

  1. Copy the full SHA
    bb2faad View commit details
  2. Copy the full SHA
    eb56c2b View commit details

Commits on Apr 8, 2018

  1. Copy the full SHA
    de83cfd View commit details

Commits on Apr 9, 2018

  1. Fix build with APP_DEBUG.

    xmrig committed Apr 9, 2018
    Copy the full SHA
    77207ea View commit details
  2. Copy the full SHA
    5b664f3 View commit details
  3. Copy the full SHA
    ccbb78d View commit details
  4. v2.6.0-beta2

    xmrig committed Apr 9, 2018
    Copy the full SHA
    82e1138 View commit details
  5. Update README.md

    xmrig authored Apr 9, 2018
    Copy the full SHA
    3090368 View commit details
  6. Update CHANGELOG.md

    xmrig authored Apr 9, 2018
    Copy the full SHA
    916ff33 View commit details

Commits on Apr 10, 2018

  1. Remove unused class UploadCtx.

    xmrig committed Apr 10, 2018
    Copy the full SHA
    0bfd409 View commit details
  2. Copy the full SHA
    3924a16 View commit details
  3. Refactoring.

    xmrig committed Apr 10, 2018
    Copy the full SHA
    ad7545d View commit details
  4. Rename class Url to Pool.

    xmrig committed Apr 10, 2018
    Copy the full SHA
    36ef254 View commit details
  5. Copy the full SHA
    1ebaf67 View commit details
Showing with 13,110 additions and 8,215 deletions.
  1. +80 −0 CHANGELOG.md
  2. +102 −62 CMakeLists.txt
  3. +118 −0 Makefile
  4. +42 −16 README.md
  5. +23 −0 cmake/OpenSSL.cmake
  6. +33 −0 cmake/asm.cmake
  7. +3 −3 cmake/flags.cmake
  8. +31 −0 doc/ALGORITHMS.md
  9. +53 −0 doc/API.md
  10. +63 −0 doc/api/1/config.json
  11. +73 −0 doc/api/1/summary.json
  12. +65 −0 doc/api/1/threads.json
  13. +12 −0 install/xmrig.service
  14. +2 −2 res/app.rc
  15. +16 −0 src/3rdparty/libcpuid/Makefile
  16. +836 −825 src/3rdparty/libcpuid/asm-bits.c
  17. +71 −53 src/3rdparty/libcpuid/asm-bits.h
  18. +28 −28 src/3rdparty/libcpuid/cpuid_main.c
  19. +20 −19 src/3rdparty/libcpuid/libcpuid.h
  20. +3 −2 src/3rdparty/libcpuid/libcpuid_internal.h
  21. +27 −1 src/3rdparty/libcpuid/libcpuid_types.h
  22. +4 −0 src/3rdparty/libcpuid/recog_amd.c
  23. +2 −1 src/3rdparty/libcpuid/recog_intel.c
  24. +28 −100 src/App.cpp
  25. +9 −13 src/App.h
  26. +4 −8 src/App_unix.cpp
  27. +5 −9 src/App_win.cpp
  28. +0 −61 src/Console.cpp
  29. +0 −49 src/Console.h
  30. +0 −67 src/Cpu.h
  31. +0 −79 src/Cpu_unix.cpp
  32. +26 −45 src/Mem.cpp
  33. +20 −18 src/Mem.h
  34. +27 −36 src/Mem_unix.cpp
  35. +27 −30 src/Mem_win.cpp
  36. +0 −761 src/Options.cpp
  37. +0 −133 src/Options.h
  38. +84 −93 src/Summary.cpp
  39. +8 −3 src/Summary.h
  40. +18 −31 src/api/Api.cpp
  41. +13 −8 src/api/Api.h
  42. +335 −0 src/api/ApiRouter.cpp
  43. +29 −17 src/api/{ApiState.h → ApiRouter.h}
  44. +0 −260 src/api/ApiState.cpp
  45. +0 −128 src/api/Httpd.cpp
  46. +3 −3 src/api/NetworkState.cpp
  47. +31 −4 src/{ → common}/Platform.cpp
  48. +15 −7 src/{ → common}/Platform.h
  49. +10 −10 src/{ → common}/Platform_mac.cpp
  50. +27 −11 src/{ → common}/Platform_unix.cpp
  51. +8 −10 src/{ → common}/Platform_win.cpp
  52. +69 −0 src/common/api/HttpBody.h
  53. +20 −14 src/{xmrig.h → common/api/HttpReply.h}
  54. +175 −0 src/common/api/HttpRequest.cpp
  55. +84 −0 src/common/api/HttpRequest.h
  56. +148 −0 src/common/api/Httpd.cpp
  57. +21 −4 src/{ → common}/api/Httpd.h
  58. +509 −0 src/common/config/CommonConfig.cpp
  59. +120 −0 src/common/config/CommonConfig.h
  60. +330 −0 src/common/config/ConfigLoader.cpp
  61. +71 −0 src/common/config/ConfigLoader.h
  62. +105 −0 src/common/config/ConfigWatcher.cpp
  63. +71 −0 src/common/config/ConfigWatcher.h
  64. +34 −41 src/{Cpu_stub.cpp → common/cpu/BasicCpuInfo.cpp}
  65. +70 −0 src/common/cpu/BasicCpuInfo.h
  66. +15 −22 src/{Cpu_arm.cpp → common/cpu/BasicCpuInfo_arm.cpp}
  67. +19 −9 src/{log/SysLog.cpp → common/cpu/Cpu.cpp}
  68. +46 −0 src/common/cpu/Cpu.h
  69. +240 −0 src/common/crypto/Algorithm.cpp
  70. +92 −0 src/common/crypto/Algorithm.h
  71. +38 −14 src/{crypto/c_keccak.c → common/crypto/keccak.cpp}
  72. +55 −0 src/common/crypto/keccak.h
  73. 0 src/{ → common}/interfaces/IClientListener.h
  74. +140 −0 src/common/interfaces/IConfig.h
  75. +16 −8 src/{interfaces/IConsoleListener.h → common/interfaces/IConfigCreator.h}
  76. +10 −19 src/{workers/SingleWorker.h → common/interfaces/IControllerListener.h}
  77. +60 −0 src/common/interfaces/ICpuInfo.h
  78. +56 −0 src/common/interfaces/ILogBackend.h
  79. 0 src/{ → common}/interfaces/IStrategy.h
  80. 0 src/{ → common}/interfaces/IStrategyListener.h
  81. +46 −0 src/common/interfaces/IWatcherListener.h
  82. +16 −39 src/{ → common}/log/ConsoleLog.cpp
  83. +12 −7 src/{ → common}/log/ConsoleLog.h
  84. +129 −0 src/common/log/FileLog.cpp
  85. +12 −5 src/{ → common}/log/FileLog.h
  86. +54 −5 src/{ → common}/log/Log.cpp
  87. +102 −0 src/common/log/Log.h
  88. +60 −0 src/common/log/SysLog.cpp
  89. +4 −4 src/{ → common}/log/SysLog.h
  90. +377 −170 src/{ → common}/net/Client.cpp
  91. +61 −29 src/{ → common}/net/Client.h
  92. 0 src/{ → common}/net/Id.h
  93. +60 −30 src/{ → common}/net/Job.cpp
  94. +108 −0 src/common/net/Job.h
  95. +407 −0 src/common/net/Pool.cpp
  96. +116 −0 src/common/net/Pool.h
  97. +95 −0 src/common/net/Storage.h
  98. +5 −4 src/{ → common}/net/SubmitResult.cpp
  99. +5 −4 src/{ → common}/net/SubmitResult.h
  100. +190 −0 src/common/net/Tls.cpp
  101. +62 −0 src/common/net/Tls.h
  102. +9 −8 src/{ → common}/net/strategies/FailoverStrategy.cpp
  103. +5 −4 src/{ → common}/net/strategies/FailoverStrategy.h
  104. +7 −6 src/{ → common}/net/strategies/SinglePoolStrategy.cpp
  105. +3 −3 src/{ → common}/net/strategies/SinglePoolStrategy.h
  106. +102 −0 src/common/utils/c_str.h
  107. +17 −19 src/{Cpu_mac.cpp → common/utils/mm_malloc.h}
  108. +47 −0 src/common/utils/timestamp.h
  109. +109 −0 src/common/xmrig.h
  110. +38 −27 src/config.json
  111. +382 −0 src/core/Config.cpp
  112. +132 −0 src/core/Config.h
  113. +20 −11 src/{interfaces/ILogBackend.h → core/ConfigCreator.h}
  114. +201 −0 src/core/ConfigLoader_platform.h
  115. +151 −0 src/core/Controller.cpp
  116. +64 −0 src/core/Controller.h
  117. +68 −68 src/{Cpu.cpp → core/cpu/AdvancedCpuInfo.cpp}
  118. +75 −0 src/core/cpu/AdvancedCpuInfo.h
  119. +25 −16 src/{Cpu_win.cpp → core/cpu/Cpu.cpp}
  120. +100 −0 src/crypto/Asm.cpp
  121. +14 −22 src/{workers/DoubleWorker.h → crypto/Asm.h}
  122. +0 −192 src/crypto/CryptoNight.cpp
  123. +5 −30 src/crypto/CryptoNight.h
  124. +381 −138 src/crypto/CryptoNight_arm.h
  125. +169 −0 src/crypto/CryptoNight_constants.h
  126. +100 −11 src/crypto/CryptoNight_monero.h
  127. +179 −21 src/crypto/CryptoNight_test.h
  128. +720 −88 src/crypto/CryptoNight_x86.h
  129. +410 −0 src/crypto/asm/cnv2_double_main_loop_sandybridge.inc
  130. +37 −0 src/crypto/asm/cnv2_main_loop.S
  131. +25 −0 src/crypto/asm/cnv2_main_loop.asm
  132. +186 −0 src/crypto/asm/cnv2_main_loop_ivybridge.inc
  133. +179 −0 src/crypto/asm/cnv2_main_loop_ryzen.inc
  134. +410 −0 src/crypto/asm/win64/cnv2_double_main_loop_sandybridge.inc
  135. +21 −0 src/crypto/asm/win64/cnv2_main_loop.S
  136. +25 −0 src/crypto/asm/win64/cnv2_main_loop.asm
  137. +186 −0 src/crypto/asm/win64/cnv2_main_loop_ivybridge.inc
  138. +179 −0 src/crypto/asm/win64/cnv2_main_loop_ryzen.inc
  139. +0 −26 src/crypto/c_keccak.h
  140. +17 −0 src/crypto/soft_aes.h
  141. +10 −4 src/donate.h
  142. +77 −0 src/interfaces/IThread.h
  143. +4 −2 src/interfaces/IWorker.h
  144. +0 −97 src/log/FileLog.cpp
  145. +0 −93 src/log/Log.h
  146. +0 −89 src/net/Job.h
  147. +4 −20 src/net/JobResult.h
  148. +37 −26 src/net/Network.cpp
  149. +9 −4 src/net/Network.h
  150. +0 −284 src/net/Url.cpp
  151. +0 −81 src/net/Url.h
  152. +26 −29 src/net/strategies/DonateStrategy.cpp
  153. +9 −8 src/net/strategies/DonateStrategy.h
  154. +6 −7 src/version.h
  155. +456 −0 src/workers/CpuThread.cpp
  156. +111 −0 src/workers/CpuThread.h
  157. +0 −152 src/workers/DoubleWorker.cpp
  158. +7 −8 src/workers/Handle.cpp
  159. +15 −12 src/workers/Handle.h
  160. +35 −22 src/workers/Hashrate.cpp
  161. +15 −7 src/workers/Hashrate.h
  162. +203 −0 src/workers/MultiWorker.cpp
  163. +75 −0 src/workers/MultiWorker.h
  164. +0 −120 src/workers/SingleWorker.cpp
  165. +10 −14 src/workers/Worker.cpp
  166. +16 −8 src/workers/Worker.h
  167. +175 −18 src/workers/Workers.cpp
  168. +43 −4 src/workers/Workers.h
  169. +0 −9 test/CMakeLists.txt
  170. +0 −16 test/autoconf/CMakeLists.txt
  171. +0 −152 test/autoconf/autoconf.c
  172. +0 −28 test/cryptonight/CMakeLists.txt
  173. +0 −136 test/cryptonight/cryptonight.c
  174. +0 −27 test/cryptonight_lite/CMakeLists.txt
  175. +0 −124 test/cryptonight_lite/cryptonight_lite.c
  176. +0 −2 test/unity/CMakeLists.txt
  177. +0 −1,446 test/unity/unity.c
  178. +0 −293 test/unity/unity.h
  179. +0 −749 test/unity/unity_internals.h
80 changes: 80 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,83 @@
# v2.8.3
- [#813](https://github.com/xmrig/xmrig/issues/813) Fixed critical bug with Minergate pool and variant 2.

# v2.8.1
- [#768](https://github.com/xmrig/xmrig/issues/768) Fixed build with Visual Studio 2015.
- [#769](https://github.com/xmrig/xmrig/issues/769) Fixed regression, some ANSI escape sequences was in log with disabled colors.
- [#777](https://github.com/xmrig/xmrig/issues/777) Better report about pool connection issues.
- Simplified checks for ASM auto detection, only AES support necessary.
- Added missing options to `--help` output.

# v2.8.0
- **[#753](https://github.com/xmrig/xmrig/issues/753) Added new algorithm [CryptoNight variant 2](https://github.com/xmrig/xmrig/issues/753) for Monero fork, thanks [@SChernykh](https://github.com/SChernykh).**
- Added global and per thread option `"asm"` and and command line equivalent.
- **[#758](https://github.com/xmrig/xmrig/issues/758) Added SSL/TLS support for secure connections to pools.**
- Added per pool options `"tls"` and `"tls-fingerprint"` and command line equivalents.
- [#767](https://github.com/xmrig/xmrig/issues/767) Added config autosave feature, same with GPU miners.
- [#245](https://github.com/xmrig/xmrig-proxy/issues/245) Fixed API ID collision when run multiple miners on same machine.
- [#757](https://github.com/xmrig/xmrig/issues/757) Fixed send buffer overflow.

# v2.6.4
- [#700](https://github.com/xmrig/xmrig/issues/700) `cryptonight-lite/ipbc` replaced to `cryptonight-heavy/tube` for **Bittube (TUBE)**.
- Added `cryptonight/rto` (cryptonight variant 1 with IPBC/TUBE mod) variant for **Arto (RTO)** coin.
- Added `cryptonight/xao` (original cryptonight with bigger iteration count) variant for **Alloy (XAO)** coin.
- Better variant detection for **nicehash.com** and **minergate.com**.
- [#692](https://github.com/xmrig/xmrig/issues/692) Added support for specify both algorithm and variant via single `algo` option.

# v2.6.3
- **Added support for new cryptonight-heavy variant xhv** (`cn-heavy/xhv`) for upcoming Haven Protocol fork.
- **Added support for new cryptonight variant msr** (`cn/msr`) also known as `cryptonight-fast` for upcoming Masari fork.
- Added new detailed hashrate report.
- [#446](https://github.com/xmrig/xmrig/issues/446) Likely fixed SIGBUS error on 32 bit ARM CPUs.
- [#551](https://github.com/xmrig/xmrig/issues/551) Fixed `cn-heavy` algorithm on ARMv8.
- [#614](https://github.com/xmrig/xmrig/issues/614) Fixed display issue with huge pages percentage when colors disabled.
- [#615](https://github.com/xmrig/xmrig/issues/615) Fixed build without libcpuid.
- [#629](https://github.com/xmrig/xmrig/pull/629) Fixed file logging with non-seekable files.
- [#672](https://github.com/xmrig/xmrig/pull/672) Reverted back `cryptonight-light` and exit if no valid algorithm specified.

# v2.6.2
- [#607](https://github.com/xmrig/xmrig/issues/607) Fixed donation bug.
- [#610](https://github.com/xmrig/xmrig/issues/610) Fixed ARM build.

# v2.6.1
- [#168](https://github.com/xmrig/xmrig-proxy/issues/168) Added support for [mining algorithm negotiation](https://github.com/xmrig/xmrig-proxy/blob/dev/doc/STRATUM_EXT.md#1-mining-algorithm-negotiation).
- Added IPBC coin support, base algorithm `cn-lite` variant `ipbc`.
- [#581](https://github.com/xmrig/xmrig/issues/581) Added support for upcoming Stellite (XTL) fork, base algorithm `cn` variant `xtl`, variant can set now, no need do it after fork.
- Added support for **rig-id** stratum protocol extensions, compatible with xmr-stak.
- Changed behavior for option `variant=-1` for `cryptonight`, now variant is `1` by default, if you mine old coins need change `variant` to `0`.
- A lot of small fixes and better unification with proxy code.

# v2.6.0-beta3
- [#563](https://github.com/xmrig/xmrig/issues/563) **Added [advanced threads mode](https://github.com/xmrig/xmrig/issues/563), now possible configure each thread individually.**
- [#255](https://github.com/xmrig/xmrig/issues/563) Low power mode extended to **triple**, **quard** and **penta** modes.
- [#519](https://github.com/xmrig/xmrig/issues/519) Fixed high donation levels, improved donation start time randomization.
- [#554](https://github.com/xmrig/xmrig/issues/554) Fixed regression with `print-time` option.

# v2.6.0-beta2
- Improved performance for `cryptonight v7` especially in double hash mode.
- [#499](https://github.com/xmrig/xmrig/issues/499) IPv6 disabled for internal HTTP API by default, was causing issues on some systems.
- Added short aliases for algorithm names: `cn`, `cn-lite` and `cn-heavy`.
- Fixed regressions (v2.6.0-beta1 affected)
- [#494](https://github.com/xmrig/xmrig/issues/494) Command line option `--donate-level` was broken.
- [#502](https://github.com/xmrig/xmrig/issues/502) Build without libmicrohttpd was broken.
- Fixed nonce calculation for `--av 4` (software AES, double hash) was causing reduction of effective hashrate and rejected shares on nicehash.

# v2.6.0-beta1
- [#476](https://github.com/xmrig/xmrig/issues/476) **Added Cryptonight-Heavy support for Sumokoin ASIC resistance fork.**
- HTTP server now runs in main loop, it make possible easy extend API without worry about thread synchronization.
- Added initial graceful reload support, miner will reload configuration if config file changed, disabled by default until it will be fully implemented and tested.
- Added API endpoint `PUT /1/config` to update current config.
- Added API endpoint `GET /1/config` to get current active config.
- Added API endpoint `GET /1/threads` to get current active threads configuration.
- API endpoint `GET /` now deprecated, use `GET /1/summary` instead.
- Added `--api-no-ipv6` and similar config option to disable IPv6 support for HTTP API.
- Added `--api-no-restricted` to enable full access to api, this option has no effect if `--api-access-token` not specified.

# v2.5.3
- Fixed critical bug, in some cases miner was can't recovery connection and switch to failover pool, version 2.5.2 affected. If you use v2.6.0-beta3 this issue doesn't concern you.
- [#499](https://github.com/xmrig/xmrig/issues/499) IPv6 support disabled for internal HTTP API.
- Added workaround for nicehash.com if you use `cryptonightv7.<region>.nicehash.com` option `variant=1` will be set automatically.

# v2.5.2
- [#448](https://github.com/xmrig/xmrig/issues/478) Fixed broken reconnect.

164 changes: 102 additions & 62 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,63 +1,78 @@
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)
option(WITH_LIBCPUID "Use Libcpuid" ON)
option(WITH_AEON "CryptoNight-Lite support" ON)
option(WITH_SUMO "CryptoNight-Heavy support" ON)
option(WITH_HTTPD "HTTP REST API" ON)
option(WITH_DEBUG_LOG "Enable debug log output" OFF)
option(WITH_TLS "Enable OpenSSL support" ON)
option(WITH_ASM "Enable ASM PoW implementations" 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/common/config/CommonConfig.h
src/common/config/ConfigLoader.h
src/common/config/ConfigWatcher.h
src/common/cpu/Cpu.h
src/common/crypto/Algorithm.h
src/common/crypto/keccak.h
src/common/interfaces/IClientListener.h
src/common/interfaces/IConfig.h
src/common/interfaces/IConfigCreator.h
src/common/interfaces/IControllerListener.h
src/common/interfaces/ICpuInfo.h
src/common/interfaces/ILogBackend.h
src/common/interfaces/IStrategy.h
src/common/interfaces/IStrategyListener.h
src/common/interfaces/IWatcherListener.h
src/common/log/ConsoleLog.h
src/common/log/FileLog.h
src/common/log/Log.h
src/common/net/Client.h
src/common/net/Id.h
src/common/net/Job.h
src/common/net/Pool.h
src/common/net/Storage.h
src/common/net/strategies/FailoverStrategy.h
src/common/net/strategies/SinglePoolStrategy.h
src/common/net/SubmitResult.h
src/common/Platform.h
src/common/utils/c_str.h
src/common/utils/mm_malloc.h
src/common/xmrig.h
src/core/ConfigLoader_platform.h
src/core/Controller.h
src/interfaces/IJobResultListener.h
src/interfaces/ILogBackend.h
src/interfaces/IStrategy.h
src/interfaces/IStrategyListener.h
src/interfaces/IThread.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/CpuThread.h
src/workers/Handle.h
src/workers/Hashrate.h
src/workers/SingleWorker.h
src/workers/MultiWorker.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_constants.h
src/crypto/CryptoNight_monero.h
src/crypto/CryptoNight_test.h
src/crypto/groestl_tables.h
@@ -73,71 +88,69 @@ else()
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/common/config/CommonConfig.cpp
src/common/config/ConfigLoader.cpp
src/common/config/ConfigWatcher.cpp
src/common/crypto/Algorithm.cpp
src/common/crypto/keccak.cpp
src/common/log/ConsoleLog.cpp
src/common/log/FileLog.cpp
src/common/log/Log.cpp
src/common/net/Client.cpp
src/common/net/Job.cpp
src/common/net/Pool.cpp
src/common/net/strategies/FailoverStrategy.cpp
src/common/net/strategies/SinglePoolStrategy.cpp
src/common/net/SubmitResult.cpp
src/common/Platform.cpp
src/core/Config.cpp
src/core/Controller.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/CpuThread.cpp
src/workers/Handle.cpp
src/workers/Hashrate.cpp
src/workers/SingleWorker.cpp
src/workers/MultiWorker.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/common/Platform_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/common/Platform_mac.cpp
src/Mem_unix.cpp
src/Platform_mac.cpp
)
else()
set(SOURCES_OS
src/App_unix.cpp
src/Cpu_unix.cpp
src/common/Platform_unix.cpp
src/Mem_unix.cpp
src/Platform_unix.cpp
)

set(EXTRA_LIBS pthread rt)
set(EXTRA_LIBS pthread rt dl)
endif()

if (CMAKE_SYSTEM_NAME STREQUAL FreeBSD)
@@ -153,7 +166,6 @@ 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")

@@ -166,37 +178,61 @@ if (WITH_LIBCPUID)

include_directories(src/3rdparty/libcpuid)
set(CPUID_LIB cpuid)
set(SOURCES_CPUID src/Cpu.cpp)
set(SOURCES_CPUID src/core/cpu/AdvancedCpuInfo.h src/core/cpu/AdvancedCpuInfo.cpp src/core/cpu/Cpu.cpp)
else()
add_definitions(/DXMRIG_NO_LIBCPUID)
set(SOURCES_CPUID src/common/cpu/BasicCpuInfo.h src/common/cpu/Cpu.cpp)

if (XMRIG_ARM)
set(SOURCES_CPUID src/Cpu_arm.cpp)
set(SOURCES_CPUID ${SOURCES_CPUID} src/common/cpu/BasicCpuInfo_arm.cpp)
else()
set(SOURCES_CPUID src/Cpu_stub.cpp)
set(SOURCES_CPUID ${SOURCES_CPUID} src/common/cpu/BasicCpuInfo.cpp)
endif()
endif()

include(cmake/OpenSSL.cmake)
include(cmake/asm.cmake)

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)
set(SOURCES_SYSLOG src/common/log/SysLog.h src/common/log/SysLog.cpp)
endif()

if (NOT WITH_AEON)
add_definitions(/DXMRIG_NO_AEON)
endif()

if (NOT WITH_SUMO)
add_definitions(/DXMRIG_NO_SUMO)
endif()

if (NOT WITH_IPBC)
add_definitions(/DXMRIG_NO_IPBC)
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)
set(HTTPD_SOURCES
src/api/Api.h
src/api/ApiRouter.h
src/common/api/HttpBody.h
src/common/api/Httpd.h
src/common/api/HttpReply.h
src/common/api/HttpRequest.h
src/api/Api.cpp
src/api/ApiRouter.cpp
src/common/api/Httpd.cpp
src/common/api/HttpRequest.cpp
)
else()
message(FATAL_ERROR "microhttpd NOT found: use `-DWITH_HTTPD=OFF` to build without http deamon support")
endif()
else()
set(HTTPD_SOURCES "")
set(MHD_LIBRARY "")
add_definitions(/DXMRIG_NO_HTTPD)
add_definitions(/DXMRIG_NO_API)
@@ -210,5 +246,9 @@ 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})
if (WITH_DEBUG_LOG)
add_definitions(/DAPP_DEBUG)
endif()

add_executable(${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})
Loading