[yaml-cpp] fix cmake and pkgconfig files (#19703)

This commit is contained in:
autoantwort 2021-09-07 23:17:18 +02:00 committed by GitHub
parent adad924a91
commit 8307923c6a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 20 additions and 17 deletions

View File

@ -6,11 +6,7 @@ vcpkg_from_github(
HEAD_REF master
)
if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
set(YAML_BUILD_SHARED_LIBS ON)
else()
set(YAML_BUILD_SHARED_LIBS OFF)
endif()
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" YAML_BUILD_SHARED_LIBS)
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
@ -22,24 +18,25 @@ vcpkg_cmake_configure(
vcpkg_cmake_install()
vcpkg_copy_pdbs()
if(EXISTS "${CURRENT_PACKAGES_DIR}/cmake")
vcpkg_cmake_config_fixup(CONFIG_PATH cmake)
endif()
if(EXISTS "${CURRENT_PACKAGES_DIR}/lib/cmake/yaml-cpp")
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/yaml-cpp)
endif()
# Remove debug include files
vcpkg_cmake_config_fixup(CONFIG_PATH share/cmake/${PORT})
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
file(RENAME "${CURRENT_PACKAGES_DIR}/debug/share/pkgconfig" "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig")
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/yaml-cpp.pc" "-lyaml-cpp" "-lyaml-cppd")
endif()
file(RENAME "${CURRENT_PACKAGES_DIR}/share/pkgconfig" "${CURRENT_PACKAGES_DIR}/lib/pkgconfig")
vcpkg_fixup_pkgconfig()
# Remove debug include and pkgconfig files
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/share/pkgconfig")
file(READ "${CURRENT_PACKAGES_DIR}/include/yaml-cpp/dll.h" DLL_H)
if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic" AND VCPKG_TARGET_IS_WINDOWS)
string(REPLACE "#ifdef YAML_CPP_DLL" "#if 1" DLL_H "${DLL_H}")
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/yaml-cpp/dll.h" "#ifdef YAML_CPP_DLL" "#if 1")
else()
string(REPLACE "#ifdef YAML_CPP_DLL" "#if 0" DLL_H "${DLL_H}")
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/yaml-cpp/dll.h" "#ifdef YAML_CPP_DLL" "#if 0")
endif()
file(WRITE "${CURRENT_PACKAGES_DIR}/include/yaml-cpp/dll.h" "${DLL_H}")
# Handle copyright
file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)

View File

@ -1,6 +1,7 @@
{
"name": "yaml-cpp",
"version-semver": "0.7.0",
"port-version": 1,
"description": "yaml-cpp is a YAML parser and emitter in C++ matching the YAML 1.2 spec.",
"homepage": "https://github.com/jbeder/yaml-cpp",
"documentation": "https://codedocs.xyz/jbeder/yaml-cpp/index.html",

View File

@ -6954,7 +6954,7 @@
},
"yaml-cpp": {
"baseline": "0.7.0",
"port-version": 0
"port-version": 1
},
"yara": {
"baseline": "4.1.1",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "a79d9c026aefee69214dbd39294da49398b07c7b",
"version-semver": "0.7.0",
"port-version": 1
},
{
"git-tree": "a71932a4f18c3cc6e0bd2bdce57fbf744e0efe2b",
"version-semver": "0.7.0",