mirror of
https://github.com/microsoft/vcpkg.git
synced 2025-01-15 05:18:02 +08:00
[secp256k1] Only install the single public header. Always build statically.
This commit is contained in:
parent
fc80d72089
commit
976195245f
@ -4,9 +4,9 @@ project(secp256k1 C)
|
||||
option(INSTALL_HEADERS "Install header files" ON)
|
||||
|
||||
add_definitions(
|
||||
-DENABLE_MODULE_ECDH
|
||||
-DENABLE_MODULE_RECOVERY
|
||||
-DHAVE_CONFIG_H
|
||||
-DENABLE_MODULE_ECDH
|
||||
-DENABLE_MODULE_RECOVERY
|
||||
-DHAVE_CONFIG_H
|
||||
)
|
||||
|
||||
file(GLOB SOURCES src/secp256k1.c)
|
||||
@ -21,6 +21,6 @@ install(TARGETS secp256k1
|
||||
)
|
||||
|
||||
if(INSTALL_HEADERS)
|
||||
file(GLOB HEADERS include/*.h)
|
||||
install(FILES ${HEADERS} DESTINATION include)
|
||||
file(GLOB HEADERS include/secp256k1.h)
|
||||
install(FILES ${HEADERS} DESTINATION include)
|
||||
endif()
|
@ -1,3 +1,3 @@
|
||||
Source: secp256k1
|
||||
Version:
|
||||
Description: Optimized C library for EC operations on curve
|
||||
Source: secp256k1
|
||||
Version: 2017-19-10-0b7024185045a49a1a6a4c5615bf31c94f63d9c4
|
||||
Description: Optimized C library for EC operations on curve
|
||||
|
@ -1,31 +1,28 @@
|
||||
include(vcpkg_common_functions)
|
||||
|
||||
set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/secp256k1-0b7024185045a49a1a6a4c5615bf31c94f63d9c4/)
|
||||
|
||||
vcpkg_from_github(
|
||||
OUT_SOURCE_PATH "secp256k1"
|
||||
REPO "bitcoin-core/secp256k1"
|
||||
REF "0b7024185045a49a1a6a4c5615bf31c94f63d9c4"
|
||||
SHA512 54e0c446ae63105800dfaf23dc934734f196c91f275db0455e58a36926c29ecc51a13d9b1eb2e45bc86199120c3c472ec7b39086787a49ce388a4df462a870bc
|
||||
)
|
||||
|
||||
message("Copying config header to " ${SOURCE_PATH})
|
||||
|
||||
file(COPY ${CURRENT_PORT_DIR}/libsecp256k1-config.h DESTINATION ${SOURCE_PATH})
|
||||
|
||||
message(STATUS "Building")
|
||||
|
||||
file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
|
||||
|
||||
vcpkg_configure_cmake(
|
||||
SOURCE_PATH ${SOURCE_PATH}
|
||||
PREFER_NINJA
|
||||
OPTIONS_DEBUG
|
||||
-DINSTALL_HEADERS=OFF
|
||||
OPTIONS_DEBUG
|
||||
)
|
||||
|
||||
vcpkg_install_cmake()
|
||||
|
||||
# Handle copyright
|
||||
file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/secp256k1 RENAME copyright)
|
||||
include(vcpkg_common_functions)
|
||||
|
||||
if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
|
||||
message(STATUS "Warning: Dynamic building not supported yet. Building static.")
|
||||
set(VCPKG_LIBRARY_LINKAGE static)
|
||||
endif()
|
||||
|
||||
vcpkg_from_github(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
REPO "bitcoin-core/secp256k1"
|
||||
REF "0b7024185045a49a1a6a4c5615bf31c94f63d9c4"
|
||||
SHA512 54e0c446ae63105800dfaf23dc934734f196c91f275db0455e58a36926c29ecc51a13d9b1eb2e45bc86199120c3c472ec7b39086787a49ce388a4df462a870bc
|
||||
)
|
||||
|
||||
file(COPY ${CURRENT_PORT_DIR}/libsecp256k1-config.h DESTINATION ${SOURCE_PATH})
|
||||
file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
|
||||
|
||||
vcpkg_configure_cmake(
|
||||
SOURCE_PATH ${SOURCE_PATH}
|
||||
PREFER_NINJA
|
||||
OPTIONS_DEBUG
|
||||
-DINSTALL_HEADERS=OFF
|
||||
)
|
||||
|
||||
vcpkg_install_cmake()
|
||||
|
||||
# Handle copyright
|
||||
file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/secp256k1 RENAME copyright)
|
||||
|
Loading…
x
Reference in New Issue
Block a user