Browse Source

common changes on windows

cl-refactor
debris 10 years ago
parent
commit
d2344f5b36
  1. 9
      cmake/EthDependencies.cmake
  2. 23
      secp256k1/CMakeLists.txt

9
cmake/EthDependencies.cmake

@ -11,8 +11,9 @@ set (CMAKE_PREFIX_PATH ${CMAKE_DEPENDENCY_INSTALL_DIR})
# TODO use proper version of windows SDK (32 vs 64)
# TODO make it possible to use older versions of windows SDK (7.0+ should also work)
# TODO it windows SDK is NOT FOUND, throw ERROR
if (${CMAKE_CXX_COMPILER_ID} MATCHES "MSVC")
if (WIN32)
set (CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} "C:/Program Files/Windows Kits/8.1/Lib/winv6.3/um/x86")
message(" - Found windows 8.1 SDK")
#set (CMAKE_PREFIX_PATH "C:/Program Files/Windows Kits/8.1/Lib/winv6.3/um/x64")
endif()
@ -65,8 +66,10 @@ endif()
# TODO gmp package does not yet check for correct version number
# TODO it is also not required in msvc build
find_package (Gmp 6.0.0)
message(" - gmp Header: ${GMP_INCLUDE_DIR}")
message(" - gmp lib : ${GMP_LIBRARY}")
if (GMP_FOUND)
message(" - gmp Header: ${GMP_INCLUDE_DIR}")
message(" - gmp lib : ${GMP_LIBRARY}")
endif()
# TODO make headless client optional
find_package (QT5Core REQUIRED)

23
secp256k1/CMakeLists.txt

@ -6,7 +6,16 @@ set(CMAKE_ASM_COMPILER "yasm")
set(EXECUTABLE secp256k1)
file(GLOB HEADERS "*.h")
if (${CMAKE_CXX_COMPILER_ID} MATCHES "MSVC")
if (APPLE OR UNIX)
if (ETH_STATIC)
add_library(${EXECUTABLE} STATIC ${EXECUTABLE}.c field_5x52_asm.asm)
else()
add_library(${EXECUTABLE} SHARED ${EXECUTABLE}.c field_5x52_asm.asm)
endif()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -DUSE_FIELD_GMP -DUSE_NUM_GMP -DUSE_FIELD_INV_NUM")
target_link_libraries(${EXECUTABLE} ${GMP_LIBRARY})
else()
include_directories(${Boost_INCLUDE_DIRS})
if(ETH_STATIC)
@ -17,17 +26,7 @@ if (${CMAKE_CXX_COMPILER_ID} MATCHES "MSVC")
# /TP - compile project as cpp project
set_target_properties(${EXECUTABLE} PROPERTIES COMPILE_FLAGS "/TP")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DUSE_NUM_BOOST -DUSE_FIELD_10X26 -DUSE_FIELD_INV_BUILTIN")
elseif (APPLE OR UNIX)
if (ETH_STATIC)
add_library(${EXECUTABLE} STATIC ${EXECUTABLE}.c field_5x52_asm.asm)
else()
add_library(${EXECUTABLE} SHARED ${EXECUTABLE}.c field_5x52_asm.asm)
endif()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -DUSE_FIELD_GMP -DUSE_NUM_GMP -DUSE_FIELD_INV_NUM")
target_link_libraries(${EXECUTABLE} ${GMP_LIBRARY})
endif()
install( TARGETS ${EXECUTABLE} ARCHIVE DESTINATION lib LIBRARY DESTINATION lib )

Loading…
Cancel
Save