aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbagong <rs@bagong.de>2017-06-06 10:11:54 +0200
committerbagong <rs@bagong.de>2017-06-06 10:11:54 +0200
commit93ebc6c7467b245ed81ed724e8b3d4db442d3f89 (patch)
treed71ad56eb67a3e6a06bc965ac1c71f1cba668d02
parente573ed00a198ea609de095243ede3b40a8e79421 (diff)
downloadvcpkg-93ebc6c7467b245ed81ed724e8b3d4db442d3f89.tar.gz
vcpkg-93ebc6c7467b245ed81ed724e8b3d4db442d3f89.zip
Make sure dsound uses version and header of current environment
-rw-r--r--ports/portaudio/CONTROL2
-rw-r--r--ports/portaudio/find_dsound.patch114
-rw-r--r--ports/portaudio/portfile.cmake3
3 files changed, 117 insertions, 2 deletions
diff --git a/ports/portaudio/CONTROL b/ports/portaudio/CONTROL
index b2fb68b84..5e5ffc57c 100644
--- a/ports/portaudio/CONTROL
+++ b/ports/portaudio/CONTROL
@@ -1,3 +1,3 @@
Source: portaudio
-Version: 19.0.6.00
+Version: 19.0.6.00-1
Description: PortAudio Portable Cross-platform Audio I/O API PortAudio is a free, cross-platform, open-source, audio I/O library. It lets you write simple audio programs in 'C' or C++ that will compile and run on many platforms including Windows, Macintosh OS X, and Unix (OSS/ALSA). It is intended to promote the exchange of audio software between developers on different platforms. Many applications use PortAudio for Audio I/O.
diff --git a/ports/portaudio/find_dsound.patch b/ports/portaudio/find_dsound.patch
new file mode 100644
index 000000000..be82b5641
--- /dev/null
+++ b/ports/portaudio/find_dsound.patch
@@ -0,0 +1,114 @@
+--- a/cmake_support/FindDXSDK.cmake
++++ b/cmake_support/FindDXSDK.cmake
+@@ -16,44 +16,70 @@ else(WIN32)
+ message(FATAL_ERROR "FindDXSDK.cmake: Unsupported platform ${CMAKE_SYSTEM_NAME}" )
+ endif(WIN32)
+
+-find_path(DXSDK_ROOT_DIR
+- include/dxsdkver.h
+- HINTS
+- $ENV{DXSDK_DIR}
+-)
+-
+-find_path(DXSDK_INCLUDE_DIR
+- dxsdkver.h
+- PATHS
+- ${DXSDK_ROOT_DIR}/include
+-)
+-
+-IF(CMAKE_CL_64)
+-find_path(DXSDK_LIBRARY_DIR
+- dsound.lib
+- PATHS
+- ${DXSDK_ROOT_DIR}/lib/x64
+-)
+-ELSE(CMAKE_CL_64)
+-find_path(DXSDK_LIBRARY_DIR
+- dsound.lib
+- PATHS
+- ${DXSDK_ROOT_DIR}/lib/x86
+-)
+-ENDIF(CMAKE_CL_64)
+-
+-find_library(DXSDK_DSOUND_LIBRARY
+- dsound.lib
+- PATHS
+- ${DXSDK_LIBRARY_DIR}
+-)
+-
+-# handle the QUIETLY and REQUIRED arguments and set DXSDK_FOUND to TRUE if
+-# all listed variables are TRUE
+-INCLUDE(FindPackageHandleStandardArgs)
+-FIND_PACKAGE_HANDLE_STANDARD_ARGS(DXSDK DEFAULT_MSG DXSDK_ROOT_DIR DXSDK_INCLUDE_DIR)
+-
+-MARK_AS_ADVANCED(
+- DXSDK_ROOT_DIR DXSDK_INCLUDE_DIR
+- DXSDK_LIBRARY_DIR DXSDK_DSOUND_LIBRARY
+-)
++# Dsound.lib is statically linked (i.e. dsound.dll not required) and DXSDK_LIBRARY_DIR not used.
++# In the environments supported by VCPKG we may as well avoid looking out for DX9 to avoid version
++# mismatch in find.
++
++if(MSVC AND MSVC_VERSION GREATER_EQUAL 1900)
++
++ # if the environment is set up properly, matching lib and header will be found
++
++ find_path(DXSDK_INCLUDE_DIR
++ dsound.h
++ )
++ find_library(DXSDK_DSOUND_LIBRARY
++ dsound.lib
++ )
++
++ INCLUDE(FindPackageHandleStandardArgs)
++ FIND_PACKAGE_HANDLE_STANDARD_ARGS(DXSDK DEFAULT_MSG DXSDK_INCLUDE_DIR DXSDK_DSOUND_LIBRARY)
++
++ MARK_AS_ADVANCED(
++ DXSDK_INCLUDE_DIR DXSDK_DSOUND_LIBRARY
++ )
++
++else()
++
++ find_path(DXSDK_ROOT_DIR
++ include/dxsdkver.h
++ HINTS
++ $ENV{DXSDK_DIR}
++ )
++
++ find_path(DXSDK_INCLUDE_DIR
++ dxsdkver.h
++ HINTS
++ ${DXSDK_ROOT_DIR}/include
++ )
++
++ IF(CMAKE_CL_64)
++ find_path(DXSDK_LIBRARY_DIR
++ dsound.lib
++ HINTS
++ ${DXSDK_ROOT_DIR}/lib/x64
++ )
++ ELSE(CMAKE_CL_64)
++ find_path(DXSDK_LIBRARY_DIR
++ dsound.lib
++ HINTS
++ ${DXSDK_ROOT_DIR}/lib/x86
++ )
++ ENDIF(CMAKE_CL_64)
++
++ find_library(DXSDK_DSOUND_LIBRARY
++ dsound.lib
++ HINTS
++ ${DXSDK_LIBRARY_DIR}
++ )
++
++ # handle the QUIETLY and REQUIRED arguments and set DXSDK_FOUND to TRUE if
++ # all listed variables are TRUE
++ INCLUDE(FindPackageHandleStandardArgs)
++ FIND_PACKAGE_HANDLE_STANDARD_ARGS(DXSDK DEFAULT_MSG DXSDK_ROOT_DIR DXSDK_INCLUDE_DIR)
++
++ MARK_AS_ADVANCED(
++ DXSDK_ROOT_DIR DXSDK_INCLUDE_DIR
++ DXSDK_LIBRARY_DIR DXSDK_DSOUND_LIBRARY
++ )
++
++endif()
diff --git a/ports/portaudio/portfile.cmake b/ports/portaudio/portfile.cmake
index b243d5a6d..582ebf4d7 100644
--- a/ports/portaudio/portfile.cmake
+++ b/ports/portaudio/portfile.cmake
@@ -18,7 +18,8 @@ vcpkg_extract_source_archive(${ARCHIVE})
vcpkg_apply_patches(
SOURCE_PATH ${SOURCE_PATH}
PATCHES
- ${CMAKE_CURRENT_LIST_DIR}/cmakelists-install.patch)
+ ${CMAKE_CURRENT_LIST_DIR}/cmakelists-install.patch
+ ${CMAKE_CURRENT_LIST_DIR}/find_dsound.patch)
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}