123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- set(LIBRARY ethash)
- if (CPPETHEREUM)
- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
- endif ()
- set(CMAKE_BUILD_TYPE Release)
- if (NOT MSVC)
- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99")
- endif()
- set(FILES util.h
- io.c
- internal.c
- ethash.h
- endian.h
- compiler.h
- fnv.h
- data_sizes.h)
- if (MSVC)
- list(APPEND FILES util_win32.c io_win32.c mmap_win32.c)
- else()
- list(APPEND FILES io_posix.c)
- endif()
- if (NOT CRYPTOPP_FOUND)
- find_package(CryptoPP 5.6.2)
- endif()
- list(APPEND FILES sha3.c sha3.h)
- add_library(ethash ${FILES})
- if (CRYPTOPP_FOUND)
- TARGET_LINK_LIBRARIES(ethash ${CRYPTOPP_LIBRARIES})
- endif()
- if (UNIX AND NOT APPLE)
- TARGET_LINK_LIBRARIES(ethash pthread m)
- endif()
- install(TARGETS ethash RUNTIME DESTINATION bin ARCHIVE DESTINATION lib LIBRARY DESTINATION lib)
|