Use canonical name for RandomX, because official RandomWOW repo not rename lib or headers, still need some solution to separate it in future.

This commit is contained in:
XMRig 2019-06-18 05:13:51 +07:00
parent 2b26874f11
commit 34e39e9946
5 changed files with 32 additions and 30 deletions

View file

@ -154,7 +154,7 @@ add_definitions(/DUNICODE)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake") set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake")
find_package(UV REQUIRED) find_package(UV REQUIRED)
find_package(RandomWOW REQUIRED) find_package(RandomX REQUIRED)
include(cmake/flags.cmake) include(cmake/flags.cmake)
@ -220,7 +220,7 @@ endif()
include_directories(src) include_directories(src)
include_directories(src/3rdparty) include_directories(src/3rdparty)
include_directories(${UV_INCLUDE_DIR}) include_directories(${UV_INCLUDE_DIR})
include_directories(${RANDOMWOW_INCLUDE_DIR}) include_directories(${RANDOMX_INCLUDE_DIR})
if (BUILD_STATIC) if (BUILD_STATIC)
set(CMAKE_EXE_LINKER_FLAGS " -static") set(CMAKE_EXE_LINKER_FLAGS " -static")
@ -231,4 +231,4 @@ if (WITH_DEBUG_LOG)
endif() endif()
add_executable(${CMAKE_PROJECT_NAME} ${HEADERS} ${SOURCES} ${SOURCES_OS} ${SOURCES_CPUID} ${HEADERS_CRYPTO} ${SOURCES_CRYPTO} ${SOURCES_SYSLOG} ${HTTP_SOURCES} ${TLS_SOURCES} ${XMRIG_ASM_SOURCES} ${CN_GPU_SOURCES}) add_executable(${CMAKE_PROJECT_NAME} ${HEADERS} ${SOURCES} ${SOURCES_OS} ${SOURCES_CPUID} ${HEADERS_CRYPTO} ${SOURCES_CRYPTO} ${SOURCES_SYSLOG} ${HTTP_SOURCES} ${TLS_SOURCES} ${XMRIG_ASM_SOURCES} ${CN_GPU_SOURCES})
target_link_libraries(${CMAKE_PROJECT_NAME} ${XMRIG_ASM_LIBRARY} ${OPENSSL_LIBRARIES} ${UV_LIBRARIES} ${RANDOMWOW_LIBRARIES} ${EXTRA_LIBS} ${CPUID_LIB}) target_link_libraries(${CMAKE_PROJECT_NAME} ${XMRIG_ASM_LIBRARY} ${OPENSSL_LIBRARIES} ${UV_LIBRARIES} ${RANDOMX_LIBRARIES} ${EXTRA_LIBS} ${CPUID_LIB})

View file

@ -1,25 +0,0 @@
find_path(
RANDOMWOW_INCLUDE_DIR
NAMES randomwow.h
PATHS "${XMRIG_DEPS}" ENV "XMRIG_DEPS"
PATH_SUFFIXES "include"
NO_DEFAULT_PATH
)
find_path(RANDOMWOW_INCLUDE_DIR NAMES randomwow.h)
find_library(
RANDOMWOW_LIBRARY
NAMES librandomwow.a randomwow librandomwow
PATHS "${XMRIG_DEPS}" ENV "XMRIG_DEPS"
PATH_SUFFIXES "lib"
NO_DEFAULT_PATH
)
find_library(RANDOMWOW_LIBRARY NAMES librandomwow.a randomwow librandomwow)
set(RANDOMWOW_LIBRARIES ${RANDOMWOW_LIBRARY})
set(RANDOMWOW_INCLUDE_DIRS ${RANDOMWOW_INCLUDE_DIR})
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(RANDOMWOW DEFAULT_MSG RANDOMWOW_LIBRARY RANDOMWOW_INCLUDE_DIR)

25
cmake/FindRandomX.cmake Normal file
View file

@ -0,0 +1,25 @@
find_path(
RANDOMX_INCLUDE_DIR
NAMES randomx.h
PATHS "${XMRIG_DEPS}" ENV "XMRIG_DEPS"
PATH_SUFFIXES "include"
NO_DEFAULT_PATH
)
find_path(RANDOMX_INCLUDE_DIR NAMES randomx.h)
find_library(
RANDOMX_LIBRARY
NAMES librandomx.a randomx librandomx
PATHS "${XMRIG_DEPS}" ENV "XMRIG_DEPS"
PATH_SUFFIXES "lib"
NO_DEFAULT_PATH
)
find_library(RANDOMX_LIBRARY NAMES librandomx.a randomx librandomx)
set(RANDOMX_LIBRARIES ${RANDOMX_LIBRARY})
set(RANDOMX_INCLUDE_DIRS ${RANDOMX_INCLUDE_DIR})
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(RANDOMX DEFAULT_MSG RANDOMX_LIBRARY RANDOMX_INCLUDE_DIR)

View file

@ -27,11 +27,13 @@
#define XMRIG_MULTIWORKER_H #define XMRIG_MULTIWORKER_H
#include <randomx.h>
#include "base/net/stratum/Job.h" #include "base/net/stratum/Job.h"
#include "Mem.h" #include "Mem.h"
#include "net/JobResult.h" #include "net/JobResult.h"
#include "workers/Worker.h" #include "workers/Worker.h"
#include "randomwow.h"
class Handle; class Handle;

View file

@ -30,11 +30,11 @@
#include <list> #include <list>
#include <uv.h> #include <uv.h>
#include <vector> #include <vector>
#include <randomx.h>
#include "base/net/stratum/Job.h" #include "base/net/stratum/Job.h"
#include "net/JobResult.h" #include "net/JobResult.h"
#include "rapidjson/fwd.h" #include "rapidjson/fwd.h"
#include "randomwow.h"
class Hashrate; class Hashrate;