Skip to content

Commit

Permalink
Make the PortAudio DLL a part of the FlexASIO DLL assembly.
Browse files Browse the repository at this point in the history
Fixes #47.
  • Loading branch information
dechamps committed Jun 23, 2019
1 parent 161d121 commit b5a24c8
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/flexasio/FlexASIO/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ target_link_libraries(FlexASIO_flexasio
)

# Note: this is SHARED, not MODULE, otherwise CMake refuses to link that in FlexASIOTest.
add_library(FlexASIO SHARED dll.def flexasio.rc ../versioninfo.rc)
add_library(FlexASIO SHARED dll.def flexasio.rc ../versioninfo.rc flexasio.manifest)
target_compile_definitions(FlexASIO PRIVATE PROJECT_DESCRIPTION="FlexASIO ASIO Driver DLL")
target_link_libraries(FlexASIO
PRIVATE FlexASIO_cflexasio
Expand Down
15 changes: 15 additions & 0 deletions src/flexasio/FlexASIO/flexasio.manifest
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<!--
This ensures that, when FlexASIO.dll is loaded, the Windows DLL Loader loads the PortAudio DLL that ships with FlexASIO.
Otherwise, we can run into a subtle problem with some applications that also link with PortAudio directly;
indeed, in that case, the default behaviour of the Windows DLL Loader is to reuse the DLL that's already
loaded, which could be different from the one that FlexASIO expects. Unpredictable behaviour ensues.
See https://github.com/dechamps/FlexASIO/issues/47 for details.
Note that we specify both 32-bit and 64-bit DLLs here. Only one of those actually exists, but the Windows
loader seems to be fine with ignoring non-existent files.
-->
<file name="portaudio_x64.dll" />
<file name="portaudio_x86.dll" />
</assembly>

0 comments on commit b5a24c8

Please sign in to comment.