Browse Source

cmake: SDL2 target is not always available

(cherry picked from commit 7cf3234efeb7a68636bcfdfb3b1507b43fbb0845)
Anonymous Maarten 8 months ago
parent
commit
b7457ff61b
1 changed files with 4 additions and 1 deletions
  1. 4 1
      CMakeLists.txt

+ 4 - 1
CMakeLists.txt

@@ -3520,7 +3520,10 @@ if(SDL_TEST)
 endif()
 
 if(MSVC AND NOT SDL_LIBC)
-  set(targets SDL2)
+  set(targets )
+  if(TARGET SDL2)
+    list(APPEND targets SDL2)
+  endif()
   if(TARGET SDL2-static)
     list(APPEND targets SDL2-static)
   endif()