Skip to content
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

MSYS XAudio build fix #8345

Merged
merged 2 commits into from Nov 26, 2020
Merged

MSYS XAudio build fix #8345

merged 2 commits into from Nov 26, 2020

Conversation

@LordAro
Copy link
Member

@LordAro LordAro commented Nov 25, 2020

Seems that recent MSYS2 packages have added an xaudio2.h header... which doesn't contain things that OTTD expects to exist.

I'm not sure of the differences between them, but since XAudio isn't intended for MSYS anyway, just add some extra stuff to the cmake check.

Also some compiler warning fixes found before I just excluded the file entirely.

@glx22 glx22 dismissed their stale review Nov 26, 2020

Hmm forgot to check MSVC, xaudio2 detection fails

Copy link
Contributor

@glx22 glx22 left a comment

Your current version always fails, even when it should not.

@@ -13,6 +13,6 @@ check_cxx_source_compiles("
#define _WIN32_WINNT _WIN32_WINNT_WIN8
#include <xaudio2.h>
int main() { return 0; }"
int main() { printf(\"%s\n\", XAUDIO2_DLL_A); return 0; }"
Copy link
Contributor

@glx22 glx22 Nov 26, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
int main() { printf(\"%s\n\", XAUDIO2_DLL_A); return 0; }"
int main() { printf(\"%s\\\\n\", XAUDIO2_DLL_A); return 0; }"

and also a missing #include <cstdio> for printf declaration

glx22
glx22 approved these changes Nov 26, 2020
@LordAro LordAro merged commit 0a9aed0 into OpenTTD:master Nov 26, 2020
6 checks passed
@LordAro LordAro deleted the msys-xaudio branch Nov 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants