Fix static build

This commit is contained in:
myd7349 2018-12-20 12:44:22 +08:00
parent 13710d5854
commit ded0d0141a

View File

@ -21,12 +21,18 @@ vcpkg_configure_cmake(
vcpkg_install_cmake()
vcpkg_fixup_cmake_targets(CONFIG_PATH lib/ponder/cmake)
vcpkg_fixup_cmake_targets(CONFIG_PATH lib/${PORT}/cmake)
file(REMOVE_RECURSE
${CURRENT_PACKAGES_DIR}/debug/include
${CURRENT_PACKAGES_DIR}/debug/lib/ponder
${CURRENT_PACKAGES_DIR}/lib/ponder)
${CURRENT_PACKAGES_DIR}/debug/lib/${PORT}
${CURRENT_PACKAGES_DIR}/lib/${PORT})
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
file(READ ${CURRENT_PACKAGES_DIR}/include/${PORT}/config.hpp _contents)
string(REPLACE "ifndef PONDER_STATIC" "if 0 //ifndef PONDER_STATIC" _contents "${_contents}")
file(WRITE ${CURRENT_PACKAGES_DIR}/include/${PORT}/config.hpp "${_contents}")
endif()
# Handle copyright
configure_file(${SOURCE_PATH}/COPYING.txt ${CURRENT_PACKAGES_DIR}/share/ponder/copyright COPYONLY)
configure_file(${SOURCE_PATH}/COPYING.txt ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright COPYONLY)