Commit bdd1d035b7680dd2861a4adfa05ad1d2aa2603d9

Anonymous Maarten 2022-07-28T02:38:04

cmake: Don't add /NODEFAULTLIB to link flags when building SDL-static

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8fc50af..853b15d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -3096,12 +3096,6 @@ if(SDL_STATIC)
     set_target_properties(SDL2-static PROPERTIES OUTPUT_NAME "SDL2")
   endif()
   set_target_properties(SDL2-static PROPERTIES POSITION_INDEPENDENT_CODE "${SDL_STATIC_PIC}")
-  # Note: The clang toolset for Visual Studio does not support /NODEFAULTLIB.
-  if(MSVC AND NOT SDL_LIBC AND NOT MSVC_CLANG AND NOT CMAKE_GENERATOR_PLATFORM STREQUAL "ARM")
-    set_target_properties(SDL2-static PROPERTIES LINK_FLAGS_RELEASE "/NODEFAULTLIB")
-    set_target_properties(SDL2-static PROPERTIES LINK_FLAGS_DEBUG "/NODEFAULTLIB")
-    set_target_properties(SDL2-static PROPERTIES STATIC_LIBRARY_FLAGS "/NODEFAULTLIB")
-  endif()
   # TODO: Win32 platforms keep the same suffix .lib for import and static
   # libraries - do we need to consider this?
   target_link_libraries(SDL2-static PRIVATE ${EXTRA_LIBS} ${EXTRA_LDFLAGS})