-
-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
build: fix building with MSVC #333
Conversation
All looks good except for the language version bump - does __declspec(align) work with newer VS versions? We should be able to stay on the old version if so. |
How's this, I added an |
Add new port FAudio, an "accuracy-focused XAudio reimplementation for open platforms". Use the PLATFORM_WIN32 cmake flag on Windows, otherwise use the sdl2 dependency. MSVC build PR is here: FNA-XNA/FAudio#333 MSYS2 package is here: https://github.com/msys2/MINGW-packages/blob/master/mingw-w64-faudio/PKGBUILD Signed-off-by: Rafael Kitover <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, will merge when CI is ready!
Add an ALIGN(type, boundary) macro with an MSVC equivalent using __declspec(align(x)) to the gcc/clang-specific __attribute__((aligned(x))). Fallback to no alignment for other compilers. Link system DLLs on Windows by name instead of as an -l linker flag, cmake automatically produces the correct linker invocation on both MINGW and MSVC. Include <windows.h> with WIN32_LEAN_AND_MEAN defined instead of including <windef.h> and <winbase.h>, because this breaks the Windows header architecture detection on MSVC. Define the GUIDs for IID_IAudioClient, IID_IAudioRenderClient, IID_IMMDeviceEnumerator and CLSID_MMDeviceEnumerator for PLATFORM_WIN32 taken from the SDK headers, because MSVC cannot find the linkage for them. Define them only for MSVC because MINGW throws a redeclaration error. Signed-off-by: Rafael Kitover <[email protected]>
Can you rerun the CI please, I fixed the MINGW fail. |
Add new port FAudio, an "accuracy-focused XAudio reimplementation for open platforms". Use the PLATFORM_WIN32 cmake flag on Windows, otherwise use the sdl2 dependency. MSVC build PR is here: FNA-XNA/FAudio#333 MSYS2 package is here: https://github.com/msys2/MINGW-packages/blob/master/mingw-w64-faudio/PKGBUILD Signed-off-by: Rafael Kitover <[email protected]>
Add new port FAudio, an "accuracy-focused XAudio reimplementation for open platforms". Use the PLATFORM_WIN32 cmake flag on Windows, otherwise use the sdl2 dependency. MSVC build PR is here: FNA-XNA/FAudio#333 MSYS2 package is here: https://github.com/msys2/MINGW-packages/blob/master/mingw-w64-faudio/PKGBUILD Signed-off-by: Rafael Kitover <[email protected]>
Add new port FAudio, an "accuracy-focused XAudio reimplementation for open platforms". Use the PLATFORM_WIN32 cmake flag on Windows, otherwise use the sdl2 dependency. MSVC build PR is here: FNA-XNA/FAudio#333 MSYS2 package is here: https://github.com/msys2/MINGW-packages/blob/master/mingw-w64-faudio/PKGBUILD Signed-off-by: Rafael Kitover <[email protected]>
Add new port FAudio, an "accuracy-focused XAudio reimplementation for open platforms". Use the PLATFORM_WIN32 cmake flag on Windows, otherwise use the sdl2 dependency. MSVC build PR is here: FNA-XNA/FAudio#333 MSYS2 package is here: https://github.com/msys2/MINGW-packages/blob/master/mingw-w64-faudio/PKGBUILD Signed-off-by: Rafael Kitover <[email protected]>
Add new port FAudio, an "accuracy-focused XAudio reimplementation for open platforms". Use the PLATFORM_WIN32 cmake flag on Windows, otherwise use the sdl2 dependency. MSVC build PR is here: FNA-XNA/FAudio#333 MSYS2 package is here: https://github.com/msys2/MINGW-packages/blob/master/mingw-w64-faudio/PKGBUILD Signed-off-by: Rafael Kitover <[email protected]>
Add new port FAudio, an "accuracy-focused XAudio reimplementation for open platforms". Use the PLATFORM_WIN32 cmake flag on Windows, otherwise use the sdl2 dependency. MSVC build PR is here: FNA-XNA/FAudio#333 , followup PR to fix alignment is here: FNA-XNA/FAudio#334 , MSYS2 package is here: https://github.com/msys2/MINGW-packages/blob/master/mingw-w64-faudio/PKGBUILD . Signed-off-by: Rafael Kitover <[email protected]>
Add new port FAudio, an "accuracy-focused XAudio reimplementation for open platforms". Use the PLATFORM_WIN32 cmake flag on Windows, otherwise use the sdl2 dependency. MSVC build PR is here: FNA-XNA/FAudio#333 , followup PR to fix alignment is here: FNA-XNA/FAudio#334 , MSYS2 package is here: https://github.com/msys2/MINGW-packages/blob/master/mingw-w64-faudio/PKGBUILD . Signed-off-by: Rafael Kitover <[email protected]>
Add new port FAudio, an "accuracy-focused XAudio reimplementation for open platforms". Use the PLATFORM_WIN32 cmake flag on Windows, otherwise use the sdl2 dependency. MSVC build PR is here: FNA-XNA/FAudio#333 , followup PR to fix alignment is here: FNA-XNA/FAudio#334 , MSYS2 package is here: https://github.com/msys2/MINGW-packages/blob/master/mingw-w64-faudio/PKGBUILD . Signed-off-by: Rafael Kitover <[email protected]>
Add new port FAudio, an "accuracy-focused XAudio reimplementation for open platforms". Use the PLATFORM_WIN32 cmake flag on Windows, otherwise use the sdl2 dependency. MSVC build PR is here: FNA-XNA/FAudio#333 , followup PR to fix alignment is here: FNA-XNA/FAudio#334 , and another followup for the SDL2 dependency: FNA-XNA/FAudio#335 , the MSYS2 package is here: https://github.com/msys2/MINGW-packages/blob/master/mingw-w64-faudio/PKGBUILD . Signed-off-by: Rafael Kitover <[email protected]>
Add an ALIGN(type, boundary) macro with an MSVC equivalent using
__declspec(align(x)) to the gcc/clang-specific
attribute((aligned(x))). Fallback to no alignment for other
compilers.
Link system DLLs on Windows by name instead of as an -l linker flag,
cmake automatically produces the correct linker invocation on both MINGW
and MSVC.
Include <windows.h> with WIN32_LEAN_AND_MEAN defined instead of
including <windef.h> and <winbase.h>, because this breaks the Windows
header architecture detection on MSVC.
Define the GUIDs for IID_IAudioClient, IID_IAudioRenderClient,
IID_IMMDeviceEnumerator and CLSID_MMDeviceEnumerator for PLATFORM_WIN32
taken from the SDK headers, because MSVC cannot find the linkage for
them.