CMakeLists.txt 851 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. set(LIBRARY ethash)
  2. if (CPPETHEREUM)
  3. set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
  4. endif ()
  5. set(CMAKE_BUILD_TYPE Release)
  6. if (NOT MSVC)
  7. set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99")
  8. endif()
  9. set(FILES util.h
  10. io.c
  11. internal.c
  12. ethash.h
  13. endian.h
  14. compiler.h
  15. fnv.h
  16. data_sizes.h)
  17. if (MSVC)
  18. list(APPEND FILES util_win32.c io_win32.c mmap_win32.c)
  19. else()
  20. list(APPEND FILES io_posix.c)
  21. endif()
  22. if (NOT CRYPTOPP_FOUND)
  23. find_package(CryptoPP 5.6.2)
  24. endif()
  25. list(APPEND FILES sha3.c sha3.h)
  26. add_library(ethash ${FILES})
  27. if (CRYPTOPP_FOUND)
  28. TARGET_LINK_LIBRARIES(ethash ${CRYPTOPP_LIBRARIES})
  29. endif()
  30. if (UNIX AND NOT APPLE)
  31. TARGET_LINK_LIBRARIES(ethash pthread m)
  32. endif()
  33. install(TARGETS ethash RUNTIME DESTINATION bin ARCHIVE DESTINATION lib LIBRARY DESTINATION lib)