cmake/sdlchecks.cmake
changeset 9414 669bf9fb901e
parent 9409 9df20f292907
child 9415 93547cc94383
     1.1 --- a/cmake/sdlchecks.cmake	Fri Mar 20 12:23:53 2015 -0400
     1.2 +++ b/cmake/sdlchecks.cmake	Fri Mar 20 21:57:15 2015 -0400
     1.3 @@ -725,7 +725,7 @@
     1.4    endif()
     1.5  endmacro()
     1.6  
     1.7 -# Rquires:
     1.8 +# Requires:
     1.9  # - nada
    1.10  # Optional:
    1.11  # - THREADS opt
    1.12 @@ -776,13 +776,17 @@
    1.13  
    1.14      # Run some tests
    1.15      set(CMAKE_REQUIRED_FLAGS "${PTHREAD_CFLAGS} ${PTHREAD_LDFLAGS}")
    1.16 -    check_c_source_runs("
    1.17 +    if(CMAKE_CROSSCOMPILING)
    1.18 +      set(HAVE_PTHREADS 1)
    1.19 +    else()
    1.20 +      check_c_source_runs("
    1.21          #include <pthread.h>
    1.22          int main(int argc, char** argv) {
    1.23            pthread_attr_t type;
    1.24            pthread_attr_init(&type);
    1.25            return 0;
    1.26          }" HAVE_PTHREADS)
    1.27 +    endif()
    1.28      if(HAVE_PTHREADS)
    1.29        set(SDL_THREAD_PTHREAD 1)
    1.30        list(APPEND EXTRA_CFLAGS ${PTHREAD_CFLAGS})
    1.31 @@ -831,9 +835,8 @@
    1.32            #include <pthread.h>
    1.33            #include <pthread_np.h>
    1.34            int main(int argc, char** argv) { return 0; }" HAVE_PTHREAD_NP_H)
    1.35 -      check_function_exists(pthread_setname_np HAVE_PTHREAD_setNAME_NP)
    1.36 -      check_function_exists(pthread_set_name_np HAVE_PTHREAD_set_NAME_NP)
    1.37 -      set(CMAKE_REQUIRED_FLAGS)
    1.38 +      check_function_exists(pthread_setname_np HAVE_PTHREAD_SETNAME_NP)
    1.39 +      check_function_exists(pthread_set_name_np HAVE_PTHREAD_SET_NAME_NP)      set(CMAKE_REQUIRED_FLAGS)
    1.40  
    1.41        set(SOURCE_FILES ${SOURCE_FILES}
    1.42            ${SDL2_SOURCE_DIR}/src/thread/pthread/SDL_systhread.c