summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorRyan C. Gordon <icculus@icculus.org>2015-03-20 21:57:15 -0400
committerRyan C. Gordon <icculus@icculus.org>2015-03-20 21:57:15 -0400
commit2e63291ed8434fbeb7a774ef2b0133ad165c3b06 (patch)
tree534fa48917a3122a619521af763db8e0c4a95e9a /cmake
parentc6b28fb9ef6974aeac1b08b342ae02d20ae5c4bb (diff)
Several corrections to the CMake project files (thanks, Ozkan!).
Fixes Bugzilla #2732.
Diffstat (limited to 'cmake')
-rw-r--r--cmake/sdlchecks.cmake13
1 files changed, 8 insertions, 5 deletions
diff --git a/cmake/sdlchecks.cmake b/cmake/sdlchecks.cmake
index e568dea895..fd54ed29ee 100644
--- a/cmake/sdlchecks.cmake
+++ b/cmake/sdlchecks.cmake
@@ -725,7 +725,7 @@ macro(CheckOpenGLESX11)
endif()
endmacro()
-# Rquires:
+# Requires:
# - nada
# Optional:
# - THREADS opt
@@ -776,13 +776,17 @@ macro(CheckPTHREAD)
# Run some tests
set(CMAKE_REQUIRED_FLAGS "${PTHREAD_CFLAGS} ${PTHREAD_LDFLAGS}")
- check_c_source_runs("
+ if(CMAKE_CROSSCOMPILING)
+ set(HAVE_PTHREADS 1)
+ else()
+ check_c_source_runs("
#include <pthread.h>
int main(int argc, char** argv) {
pthread_attr_t type;
pthread_attr_init(&type);
return 0;
}" HAVE_PTHREADS)
+ endif()
if(HAVE_PTHREADS)
set(SDL_THREAD_PTHREAD 1)
list(APPEND EXTRA_CFLAGS ${PTHREAD_CFLAGS})
@@ -831,9 +835,8 @@ macro(CheckPTHREAD)
#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)
- set(CMAKE_REQUIRED_FLAGS)
+ check_function_exists(pthread_setname_np HAVE_PTHREAD_SETNAME_NP)
+ check_function_exists(pthread_set_name_np HAVE_PTHREAD_SET_NAME_NP) set(CMAKE_REQUIRED_FLAGS)
set(SOURCE_FILES ${SOURCE_FILES}
${SDL2_SOURCE_DIR}/src/thread/pthread/SDL_systhread.c