REDACTED-rig/cmake/FindMHD.cmake
enWILLYado c1f1cb0f47
Update from master (#6)
* 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
2018-03-14 22:30:47 +01:00

49 lines
1.4 KiB
CMake

# - Try to find MHD
# Once done this will define
#
# MHD_FOUND - system has MHD
# MHD_INCLUDE_DIRS - the MHD include directory
# MHD_LIBRARY - Link these to use MHD
find_path(
MHD_INCLUDE_DIR
NAMES microhttpd.h
PATHS "${XMRIG_DEPS}" ENV "XMRIG_DEPS"
PATH_SUFFIXES "include"
DOC "microhttpd include dir"
NO_DEFAULT_PATH
)
find_path(MHD_INCLUDE_DIR NAMES microhttpd.h)
find_library(
MHD_LIBRARY
NAMES libmicrohttpd.a microhttpd libmicrohttpd
PATHS "${XMRIG_DEPS}" ENV "XMRIG_DEPS"
PATH_SUFFIXES "lib"
DOC "microhttpd library"
NO_DEFAULT_PATH
)
find_library(MHD_LIBRARY NAMES microhttpd libmicrohttpd)
set(MHD_INCLUDE_DIRS ${MHD_INCLUDE_DIR})
set(MHD_LIBRARIES ${MHD_LIBRARY})
# debug library on windows
# 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)
find_library(
MHD_LIBRARY_DEBUG
NAMES microhttpd_d microhttpd-10_d libmicrohttpd_d libmicrohttpd-dll_d
DOC "mhd debug library"
)
set(MHD_LIBRARIES optimized ${MHD_LIBRARIES} debug ${MHD_LIBRARY_DEBUG})
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(MHD DEFAULT_MSG MHD_LIBRARY MHD_INCLUDE_DIR)
mark_as_advanced(MHD_INCLUDE_DIR MHD_LIBRARY)