bogdanadnan / multiminer

cpuminer-opt fork with support for GPU mining for argon2d coins
GNU General Public License v2.0
25 stars 35 forks source link

Small modifications in CMakeLists.txt to improve building process in … #23

Closed frozen80 closed 2 years ago

frozen80 commented 2 years ago

…Windows

This is a fast solution I found for Windows compilation with newest versions of gcc (Ex: gcc v11.2.0)

Edit CMakeLists.txt:

IF (WIN32 AND NOT MSVC)
    set(DEPRECATION_FLAGS "-Xlinker --allow-multiple-definition -w")
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${DEPRECATION_FLAGS}")
    set(C_DEP_FLAGS "-w")
    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${C_DEP_FLAGS}")
ENDIF()

And at line 314

IF (WIN32)
     target_compile_options(multiminer PRIVATE -O1 -mtune=native -march=native -I.)
ELSE()
     target_compile_options(multiminer PRIVATE -O3 -mtune=native -march=native -I.)
ENDIF()

Use cmake with the extra params to remove some warnings and setup NO_CUDA var here to avoid editing CMakeLists.txt file:

cmake .. -Wno-dev -DNO_CUDA=TRUE -G "MinGW Makefiles"

frozen80 commented 2 years ago

Target was modified to multiminer.

bogdanadnan commented 2 years ago

Thank you!