diff options
author | Ryan C. Gordon <icculus@icculus.org> | 2020-04-13 15:22:09 -0400 |
---|---|---|
committer | Ryan C. Gordon <icculus@icculus.org> | 2020-04-13 15:22:09 -0400 |
commit | ef00dfb506a66bf795d5bb51dd7a0c89fca98fc3 (patch) | |
tree | dd5771ed5813f66c9d92e23b9bcdb5c691b170a5 /cmake | |
parent | 1f3de6b3c6c111e6f026cd1154f4e6db69e30649 (diff) | |
download | sdl-ef00dfb506a66bf795d5bb51dd7a0c89fca98fc3.tar.gz |
cmake: use check_symbol_exists, not check_function_exists (thanks, Manuel!)
This fixes the problem where we think iOS has fseeko64, etc, but doesn't.
Fixes Bugzilla #4885.
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/sdlchecks.cmake | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/cmake/sdlchecks.cmake b/cmake/sdlchecks.cmake index 2d1372991..4c34ed4c6 100644 --- a/cmake/sdlchecks.cmake +++ b/cmake/sdlchecks.cmake @@ -30,7 +30,7 @@ macro(FindLibraryAndSONAME _LIB) endmacro() macro(CheckDLOPEN) - check_function_exists(dlopen HAVE_DLOPEN) + check_symbol_exists(dlopen "dlfcn.h" HAVE_DLOPEN) if(NOT HAVE_DLOPEN) foreach(_LIBNAME dl tdl) check_library_exists("${_LIBNAME}" "dlopen" "" DLOPEN_LIB) @@ -424,7 +424,7 @@ macro(CheckX11) set(X11_SHARED OFF) endif() - check_function_exists("shmat" HAVE_SHMAT) + check_symbol_exists(shmat "sys/shm.h" HAVE_SHMAT) if(NOT HAVE_SHMAT) check_library_exists(ipc shmat "" HAVE_SHMAT) if(HAVE_SHMAT) @@ -476,7 +476,7 @@ macro(CheckX11) set(SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS 1) endif() - check_function_exists(XkbKeycodeToKeysym SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM) + check_symbol_exists(XkbKeycodeToKeysym "X11/Xlib.h;X11/XKBlib.h" SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM) if(VIDEO_X11_XCURSOR AND HAVE_XCURSOR_H) set(HAVE_VIDEO_X11_XCURSOR TRUE) @@ -901,12 +901,14 @@ macro(CheckPTHREAD) endif() endif() - check_c_source_compiles(" - #include <pthread.h> - #include <pthread_np.h> - int main(int argc, char** argv) { return 0; }" HAVE_PTHREAD_NP_H) - check_function_exists(pthread_setname_np HAVE_PTHREAD_SETNAME_NP) - check_function_exists(pthread_set_name_np HAVE_PTHREAD_SET_NAME_NP) + check_include_files("pthread.h" HAVE_PTHREAD_H) + check_include_files("pthread_np.h" HAVE_PTHREAD_NP_H) + if (HAVE_PTHREAD_H) + check_symbol_exists(pthread_setname_np "pthread.h" HAVE_PTHREAD_SETNAME_NP) + if (HAVE_PTHREAD_NP_H) + check_symbol_exists(pthread_set_name_np "pthread.h;pthread_np.h" HAVE_PTHREAD_SET_NAME_NP) + endif() + endif() set(SOURCE_FILES ${SOURCE_FILES} ${SDL2_SOURCE_DIR}/src/thread/pthread/SDL_systhread.c |