Commit 4c704ecfdd814f3ab4613b374f4b70ffed997662

Anonymous Maarten 2022-11-01T16:33:21

cmake: use SDL2-static as static library output name when prefix/static == ""/".lib" Apparently, some clang@Windows compilers do this.

diff --git a/CMakeLists.txt b/CMakeLists.txt
index c1c9e91..15999d2 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -35,7 +35,7 @@ endif()
 # Build in parallel under Visual Studio. Not enabled by default.
 if(MSVC)
   target_compile_options(sdl-build-options INTERFACE "/MP")
-endif(MSVC)
+endif()
 
 # CMake 3.0 expands the "if(${A})" in "set(OFF 1);set(A OFF);if(${A})" to "if(1)"
 # CMake 3.24+ emits a warning when not set.
@@ -2985,7 +2985,7 @@ foreach(_hdr IN LISTS SDL2_INCLUDE_FILES)
 endforeach()
 list(APPEND SDL_GENERATED_HEADERS ${SDL2_COPIED_INCLUDE_FILES})
 
-if(MSVC OR (WATCOM AND (WIN32 OR OS2)))
+if(CMAKE_STATIC_LIBRARY_PREFIX STREQUAL "" AND CMAKE_STATIC_LIBRARY_SUFFIX STREQUAL ".lib")
   # Avoid conflict between the dll import library and the static library
   set(sdl_static_libname "SDL2-static")
 else()