summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorpsychocrypt <psychocrypt@users.noreply.github.com>2017-11-18 21:24:42 +0100
committerpsychocrypt <psychocrypt@users.noreply.github.com>2017-11-18 21:24:42 +0100
commit7e8475ab306ce865fd0c24fcf972db098298a534 (patch)
treed06f9fcabadf5966b0f458f6ff83252e8f124946 /CMakeLists.txt
parentf50fa7d84d6cca05d0684c6f018ad5928301eafe (diff)
downloadxmr-stak-7e8475ab306ce865fd0c24fcf972db098298a534.zip
xmr-stak-7e8475ab306ce865fd0c24fcf972db098298a534.tar.gz
fix OpenCL compatibility
- enforce that only host side OpenCl 1.2 functions are used if the miner is compiled with `XMR-STAK_COMPILE=generic` - update documentation - add CMake option `XMR-STAK_COMPILE` to windows
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt15
1 files changed, 9 insertions, 6 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 09c7cec..33e97ea 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -39,15 +39,18 @@ set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "${BUILD_TYPE}")
set(XMR-STAK_CURRENCY "all" CACHE STRING "select miner currency")
set_property(CACHE XMR-STAK_CURRENCY PROPERTY STRINGS "all;monero;aeon")
-if(NOT CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
- set(XMR-STAK_COMPILE "native" CACHE STRING "select CPU compute architecture")
- set_property(CACHE XMR-STAK_COMPILE PROPERTY STRINGS "native;generic")
- if("${XMR-STAK_COMPILE}" STREQUAL "native")
+
+set(XMR-STAK_COMPILE "native" CACHE STRING "select CPU compute architecture")
+set_property(CACHE XMR-STAK_COMPILE PROPERTY STRINGS "native;generic")
+if("${XMR-STAK_COMPILE}" STREQUAL "native")
+ if(NOT CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
set(CMAKE_CXX_FLAGS "-march=native -mtune=native ${CMAKE_CXX_FLAGS}")
set(CMAKE_C_FLAGS "-march=native -mtune=native ${CMAKE_C_FLAGS}")
- elseif(NOT "${XMR-STAK_COMPILE}" STREQUAL "generic")
- message(FATAL_ERROR "XMR-STAK_COMPILE is set to an unknown value '${XMR-STAK_COMPILE}'")
endif()
+elseif("${XMR-STAK_COMPILE}" STREQUAL "generic")
+ add_definitions("-DCONF_ENFORCE_OpenCL_1_2=1")
+else()
+ message(FATAL_ERROR "XMR-STAK_COMPILE is set to an unknown value '${XMR-STAK_COMPILE}'")
endif()
if("${XMR-STAK_CURRENCY}" STREQUAL "all")
OpenPOWER on IntegriCloud