cmake: don't use /NODEFAULTLIB if we are using the C runtime (thanks, Rob!).
authorRyan C. Gordon <icculus@icculus.org>
Tue, 06 Jun 2017 13:39:29 -0400
changeset 1107061401688628e
parent 11069 abf45a095845
child 11071 a4c90708251c
cmake: don't use /NODEFAULTLIB if we are using the C runtime (thanks, Rob!).

Fixes Bugzilla #3640.
CMakeLists.txt
     1.1 --- a/CMakeLists.txt	Tue Jun 06 13:12:43 2017 -0400
     1.2 +++ b/CMakeLists.txt	Tue Jun 06 13:39:29 2017 -0400
     1.3 @@ -1584,7 +1584,7 @@
     1.4        SOVERSION ${LT_REVISION}
     1.5        OUTPUT_NAME "SDL2")
     1.6    endif()
     1.7 -  if(MSVC)
     1.8 +  if(MSVC AND NOT LIBC)
     1.9      # Don't try to link with the default set of libraries.
    1.10      set_target_properties(SDL2 PROPERTIES LINK_FLAGS_RELEASE "/NODEFAULTLIB")
    1.11      set_target_properties(SDL2 PROPERTIES LINK_FLAGS_DEBUG "/NODEFAULTLIB")
    1.12 @@ -1599,7 +1599,7 @@
    1.13    add_library(SDL2-static STATIC ${SOURCE_FILES})
    1.14    set_target_properties(SDL2-static PROPERTIES OUTPUT_NAME "SDL2")
    1.15    set_target_properties(SDL2-static PROPERTIES POSITION_INDEPENDENT_CODE ${SDL_STATIC_PIC})
    1.16 -  if(MSVC)
    1.17 +  if(MSVC AND NOT LIBC)
    1.18      set_target_properties(SDL2-static PROPERTIES LINK_FLAGS_RELEASE "/NODEFAULTLIB")
    1.19      set_target_properties(SDL2-static PROPERTIES LINK_FLAGS_DEBUG "/NODEFAULTLIB")
    1.20      set_target_properties(SDL2-static PROPERTIES STATIC_LIBRARY_FLAGS "/NODEFAULTLIB")