Skip to content

Conversation

@madebr
Copy link
Contributor

@madebr madebr commented Jan 8, 2023

Fixes #7026

@madebr madebr merged commit 61f76ef into libsdl-org:main Jan 8, 2023
@madebr madebr deleted the cmake-check-with--D_GNU_SOURCE=1 branch January 8, 2023 18:08
@sezero
Copy link
Contributor

sezero commented Jan 8, 2023

SDL2 (and release-2.26.x) branches need a similar fix, although I'm not sure whether it's worth it.

@madebr
Copy link
Contributor Author

madebr commented Jan 8, 2023

Pushed as 460b7b2 and e312fbb

@sezero
Copy link
Contributor

sezero commented Jan 8, 2023

Assuming CMAKE_REQUIRED_FLAGS affects check_c_source_compiles,
is the following OK as a follow-up cleanup?

diff --git a/cmake/sdlchecks.cmake b/cmake/sdlchecks.cmake
index ee24d57..8700441 100644
--- a/cmake/sdlchecks.cmake
+++ b/cmake/sdlchecks.cmake
@@ -820,7 +820,6 @@ macro(CheckPTHREAD)
       list(APPEND SDL_PC_CFLAGS ${PTHREAD_CFLAGS})
 
       check_c_source_compiles("
-        #define _GNU_SOURCE 1
         #include <pthread.h>
         int main(int argc, char **argv) {
           pthread_mutexattr_t attr;
@@ -831,7 +830,6 @@ macro(CheckPTHREAD)
         set(SDL_THREAD_PTHREAD_RECURSIVE_MUTEX 1)
       else()
         check_c_source_compiles("
-            #define _GNU_SOURCE 1
             #include <pthread.h>
             int main(int argc, char **argv) {
               pthread_mutexattr_t attr;
@@ -862,7 +860,6 @@ macro(CheckPTHREAD)
       check_include_file(pthread_np.h HAVE_PTHREAD_NP_H)
       if (HAVE_PTHREAD_H)
         check_c_source_compiles("
-            #define _GNU_SOURCE 1
             #include <pthread.h>
             int main(int argc, char **argv) {
               pthread_setname_np(pthread_self(), \"\");

@madebr
Copy link
Contributor Author

madebr commented Jan 8, 2023

Yes, that should be fine!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cmake: strcasestr detection fails

2 participants