2020-10-15 08:38:40 +08:00
|
|
|
vcpkg_fail_port_install(ON_TARGET "uwp")
|
2019-10-15 07:34:34 +08:00
|
|
|
vcpkg_from_git(
|
2018-10-24 07:43:28 +08:00
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
2019-10-15 07:34:34 +08:00
|
|
|
URL https://git.assembla.com/portaudio.git
|
|
|
|
REF c5d2c51bd6fe354d0ee1119ba932bfebd3ebfacc
|
2019-11-23 04:46:19 +08:00
|
|
|
PATCHES
|
|
|
|
fix-library-can-not-be-found.patch
|
|
|
|
fix-include.patch
|
2018-10-24 07:43:28 +08:00
|
|
|
)
|
2017-03-06 18:41:45 +08:00
|
|
|
|
2020-10-14 04:27:26 +08:00
|
|
|
string(COMPARE EQUAL ${VCPKG_LIBRARY_LINKAGE} dynamic PA_BUILD_SHARED)
|
|
|
|
string(COMPARE EQUAL ${VCPKG_LIBRARY_LINKAGE} static PA_BUILD_STATIC)
|
|
|
|
|
2017-06-06 17:02:33 +08:00
|
|
|
# NOTE: the ASIO backend will be built automatically if the ASIO-SDK is provided
|
|
|
|
# in a sibling folder of the portaudio source in vcpkg/buildtrees/portaudio/src
|
2017-03-06 18:41:45 +08:00
|
|
|
vcpkg_configure_cmake(
|
|
|
|
SOURCE_PATH ${SOURCE_PATH}
|
|
|
|
PREFER_NINJA
|
2017-06-06 17:02:33 +08:00
|
|
|
OPTIONS
|
2020-02-05 06:47:15 +08:00
|
|
|
-DPA_USE_DS=ON
|
2017-06-06 17:02:33 +08:00
|
|
|
-DPA_USE_WASAPI=ON
|
|
|
|
-DPA_USE_WDMKS=ON
|
|
|
|
-DPA_USE_WMME=ON
|
2019-11-23 04:46:19 +08:00
|
|
|
-DPA_LIBNAME_ADD_SUFFIX=OFF
|
2020-10-14 04:27:26 +08:00
|
|
|
-DPA_BUILD_SHARED=${PA_BUILD_SHARED}
|
|
|
|
-DPA_BUILD_STATIC=${PA_BUILD_STATIC}
|
2020-10-15 08:38:40 +08:00
|
|
|
-DPA_DLL_LINK_WITH_STATIC_RUNTIME=OFF
|
2020-02-05 06:47:15 +08:00
|
|
|
OPTIONS_DEBUG
|
|
|
|
-DPA_ENABLE_DEBUG_OUTPUT:BOOL=ON
|
2017-03-06 18:41:45 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
vcpkg_install_cmake()
|
2019-10-15 07:34:34 +08:00
|
|
|
vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/${PORT})
|
2018-11-07 10:26:01 +08:00
|
|
|
vcpkg_copy_pdbs()
|
|
|
|
|
2017-03-06 18:41:45 +08:00
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
|
2019-11-23 04:46:19 +08:00
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
|
|
|
|
|
|
|
|
if(VCPKG_LIBRARY_LINKAGE STREQUAL static)
|
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
# Handle copyright
|
2020-10-14 04:27:26 +08:00
|
|
|
file(INSTALL ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
|