cmake/sdlchecks.cmake
changeset 10329 ad0bee16b6b9
parent 10005 dea345d3b00a
child 10490 24472af11074
     1.1 --- a/cmake/sdlchecks.cmake	Tue Sep 13 00:03:49 2016 -0700
     1.2 +++ b/cmake/sdlchecks.cmake	Tue Sep 13 00:03:50 2016 -0700
     1.3 @@ -766,7 +766,8 @@
     1.4      endif()
     1.5  
     1.6      # Run some tests
     1.7 -    set(CMAKE_REQUIRED_FLAGS "${PTHREAD_CFLAGS} ${PTHREAD_LDFLAGS}")
     1.8 +    set(ORIG_CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}")
     1.9 +    set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} ${PTHREAD_CFLAGS} ${PTHREAD_LDFLAGS}")
    1.10      if(CMAKE_CROSSCOMPILING)
    1.11        set(HAVE_PTHREADS 1)
    1.12      else()
    1.13 @@ -828,7 +829,7 @@
    1.14            int main(int argc, char** argv) { return 0; }" HAVE_PTHREAD_NP_H)
    1.15        check_function_exists(pthread_setname_np HAVE_PTHREAD_SETNAME_NP)
    1.16        check_function_exists(pthread_set_name_np HAVE_PTHREAD_SET_NAME_NP)
    1.17 -      set(CMAKE_REQUIRED_FLAGS)
    1.18 +      set(CMAKE_REQUIRED_FLAGS "${ORIG_CMAKE_REQUIRED_FLAGS}")
    1.19  
    1.20        set(SOURCE_FILES ${SOURCE_FILES}
    1.21            ${SDL2_SOURCE_DIR}/src/thread/pthread/SDL_systhread.c
    1.22 @@ -882,7 +883,8 @@
    1.23      endif()
    1.24    endif()
    1.25  
    1.26 -  set(CMAKE_REQUIRED_FLAGS "${USB_CFLAGS}")
    1.27 +  set(ORIG_CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}")
    1.28 +  set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} ${USB_CFLAGS}")
    1.29    set(CMAKE_REQUIRED_LIBRARIES "${USB_LIBS}")
    1.30    check_c_source_compiles("
    1.31         #include <sys/types.h>
    1.32 @@ -983,7 +985,7 @@
    1.33      set(HAVE_SDL_JOYSTICK TRUE)
    1.34  
    1.35      set(CMAKE_REQUIRED_LIBRARIES)
    1.36 -    set(CMAKE_REQUIRED_FLAGS)
    1.37 +    set(CMAKE_REQUIRED_FLAGS "${ORIG_CMAKE_REQUIRED_FLAGS}")
    1.38    endif()
    1.39  endmacro()
    1.40  
    1.41 @@ -997,12 +999,13 @@
    1.42      listtostr(VIDEO_RPI_INCLUDE_DIRS VIDEO_RPI_INCLUDE_FLAGS "-I")
    1.43      listtostr(VIDEO_RPI_LIBRARY_DIRS VIDEO_RPI_LIBRARY_FLAGS "-L")
    1.44  
    1.45 -    set(CMAKE_REQUIRED_FLAGS "${VIDEO_RPI_INCLUDE_FLAGS} ${VIDEO_RPI_LIBRARY_FLAGS}")
    1.46 +    set(ORIG_CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}")
    1.47 +    set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} ${VIDEO_RPI_INCLUDE_FLAGS} ${VIDEO_RPI_LIBRARY_FLAGS}")
    1.48      set(CMAKE_REQUIRED_LIBRARIES "${VIDEO_RPI_LIBS}")
    1.49      check_c_source_compiles("
    1.50          #include <bcm_host.h>
    1.51          int main(int argc, char **argv) {}" HAVE_VIDEO_RPI)
    1.52 -    set(CMAKE_REQUIRED_FLAGS)
    1.53 +    set(CMAKE_REQUIRED_FLAGS "${ORIG_CMAKE_REQUIRED_FLAGS}")
    1.54      set(CMAKE_REQUIRED_LIBRARIES)
    1.55  
    1.56      if(SDL_VIDEO AND HAVE_VIDEO_RPI)