mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-05 19:08:12 +00:00
cmake: only add SDL_LIBC=0 compile options to SDL2 libraries
This commit is contained in:
@@ -1779,14 +1779,6 @@ elseif(WINDOWS)
|
||||
list(APPEND SOURCE_FILES ${WINRT_SOURCE_FILES})
|
||||
endif()
|
||||
|
||||
if(MSVC AND NOT SDL_LIBC)
|
||||
# Prevent codegen that would use the VC runtime libraries.
|
||||
set_property(DIRECTORY . APPEND PROPERTY COMPILE_OPTIONS "/GS-;/Gs1048576")
|
||||
if(NOT ARCH_64 AND NOT CMAKE_GENERATOR_PLATFORM STREQUAL "ARM")
|
||||
set_property(DIRECTORY . APPEND PROPERTY COMPILE_OPTIONS "/arch:SSE")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(SDL_MISC)
|
||||
if(WINDOWS_STORE)
|
||||
file(GLOB MISC_SOURCES ${SDL2_SOURCE_DIR}/src/misc/winrt/*.cpp)
|
||||
@@ -3530,6 +3522,20 @@ if(SDL_TEST)
|
||||
set_property(TARGET SDL2_test PROPERTY INTERFACE_SDL_VERSION "SDL2")
|
||||
endif()
|
||||
|
||||
if(MSVC AND NOT SDL_LIBC)
|
||||
set(targets SDL2)
|
||||
if(TARGET SDL2-static)
|
||||
list(APPEND targets SDL2-static)
|
||||
endif()
|
||||
if(TARGET SDL2_test)
|
||||
list(APPEND targets SDL2_test)
|
||||
endif()
|
||||
set_property(TARGET ${targets} APPEND PROPERTY COMPILE_OPTIONS "/GS-;/Gs1048576")
|
||||
if(NOT ARCH_64 AND NOT CMAKE_GENERATOR_PLATFORM STREQUAL "ARM")
|
||||
set_property(TARGET ${targets} APPEND PROPERTY COMPILE_OPTIONS "/arch:SSE")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
##### Installation targets #####
|
||||
if(NOT SDL2_DISABLE_INSTALL)
|
||||
if(SDL_SHARED)
|
||||
|
Reference in New Issue
Block a user