Merge pull request #5003 from myd7349/issue-3374-3385

[libsodium] Fix #3374, #3385
This commit is contained in:
Phil Christensen 2018-12-22 23:30:22 -08:00 committed by GitHub
commit 27aa5a402f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -22,18 +22,20 @@ else()
set(LIBSODIUM_DEBUG_CONFIGURATION Debug)
endif()
vcpkg_build_msbuild(
PROJECT_PATH ${SOURCE_PATH}/libsodium.vcxproj
RELEASE_CONFIGURATION ${LIBSODIUM_RELEASE_CONFIGURATION}
DEBUG_CONFIGURATION ${LIBSODIUM_DEBUG_CONFIGURATION}
)
IF(VCPKG_TARGET_ARCHITECTURE MATCHES "x86")
SET(BUILD_ARCH "Win32")
ELSE()
SET(BUILD_ARCH ${VCPKG_TARGET_ARCHITECTURE})
ENDIF()
vcpkg_build_msbuild(
PROJECT_PATH ${SOURCE_PATH}/libsodium.vcxproj
RELEASE_CONFIGURATION ${LIBSODIUM_RELEASE_CONFIGURATION}
DEBUG_CONFIGURATION ${LIBSODIUM_DEBUG_CONFIGURATION}
OPTIONS
/p:ForceImportBeforeCppTargets=${SOURCE_PATH}/builds/msvc/properties/${BUILD_ARCH}.props
)
file(INSTALL
${SOURCE_PATH}/src/libsodium/include/sodium.h
DESTINATION ${CURRENT_PACKAGES_DIR}/include
@ -45,6 +47,12 @@ file(INSTALL
DESTINATION ${CURRENT_PACKAGES_DIR}/include/sodium
)
if (VCPKG_LIBRARY_LINKAGE STREQUAL "static")
file(READ ${CURRENT_PACKAGES_DIR}/include/sodium/export.h _contents)
string(REPLACE "#ifdef SODIUM_STATIC" "#if 1 //#ifdef SODIUM_STATIC" _contents "${_contents}")
file(WRITE ${CURRENT_PACKAGES_DIR}/include/sodium/export.h "${_contents}")
endif ()
if (VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
file(INSTALL
${SOURCE_PATH}/Build/${LIBSODIUM_RELEASE_CONFIGURATION}/${BUILD_ARCH}/libsodium.dll