Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 12 additions & 15 deletions ports/yaml-cpp/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand All @@ -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)

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 files
# 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)
1 change: 1 addition & 0 deletions ports/yaml-cpp/vcpkg.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -6882,7 +6882,7 @@
},
"yaml-cpp": {
"baseline": "0.7.0",
"port-version": 0
"port-version": 1
},
"yara": {
"baseline": "4.1.1",
Expand Down
5 changes: 5 additions & 0 deletions versions/y-/yaml-cpp.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "a79d9c026aefee69214dbd39294da49398b07c7b",
"version-semver": "0.7.0",
"port-version": 1
},
{
"git-tree": "a71932a4f18c3cc6e0bd2bdce57fbf744e0efe2b",
"version-semver": "0.7.0",
Expand Down