From a9524ffa9d0dbe4b5bb9f2a857033ab6c2296336 Mon Sep 17 00:00:00 2001 From: Anonymous Maarten Date: Tue, 27 Sep 2022 01:52:28 +0200 Subject: [PATCH] cmake: make sure check_c_source_compiles uses 2 different variables in CheckOSS --- cmake/sdlchecks.cmake | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/cmake/sdlchecks.cmake b/cmake/sdlchecks.cmake index 8b7eb03a6..cfc0c664a 100644 --- a/cmake/sdlchecks.cmake +++ b/cmake/sdlchecks.cmake @@ -56,21 +56,19 @@ endmacro() # - n/a macro(CheckOSS) if(SDL_OSS) - set(OSS_HEADER_FILE "sys/soundcard.h") check_c_source_compiles(" #include - int main(int argc, char **argv) { int arg = SNDCTL_DSP_SETFRAGMENT; return 0; }" OSS_FOUND) - if(NOT OSS_FOUND) - set(OSS_HEADER_FILE "soundcard.h") + int main(int argc, char **argv) { int arg = SNDCTL_DSP_SETFRAGMENT; return 0; }" HAVE_OSS_SYS_SOUNDCARD_H) + if(NOT HAVE_OSS_SYS_SOUNDCARD_H) check_c_source_compiles(" #include - int main(int argc, char **argv) { int arg = SNDCTL_DSP_SETFRAGMENT; return 0; }" OSS_FOUND) + int main(int argc, char **argv) { int arg = SNDCTL_DSP_SETFRAGMENT; return 0; }" HAVE_OSS_SOUNDCARD_H) endif() - if(OSS_FOUND) + if(HAVE_OSS_SYS_SOUNDCARD_H OR HAVE_OSS_SOUNDCARD_H) set(HAVE_OSS TRUE) file(GLOB OSS_SOURCES ${SDL2_SOURCE_DIR}/src/audio/dsp/*.c) - if(OSS_HEADER_FILE STREQUAL "soundcard.h") + if(HAVE_OSS_SOUNDCARD_H) set(SDL_AUDIO_DRIVER_OSS_SOUNDCARD_H 1) endif() set(SDL_AUDIO_DRIVER_OSS 1)