Re-apply megasource changes to SDL's cmake file

This commit is contained in:
Alex Szpakowski
2021-12-03 18:40:53 -04:00
parent 8ff9d249b2
commit 4f24e5473f
+13
View File
@@ -333,6 +333,8 @@ if(VITA)
set(SDL_LOADSO_ENABLED_BY_DEFAULT OFF) set(SDL_LOADSO_ENABLED_BY_DEFAULT OFF)
endif() endif()
set(BUILD_SHARED_LIBS ON)
# When defined, respect CMake's BUILD_SHARED_LIBS setting: # When defined, respect CMake's BUILD_SHARED_LIBS setting:
set(SDL_STATIC_ENABLED_BY_DEFAULT ON) set(SDL_STATIC_ENABLED_BY_DEFAULT ON)
if (NOT DEFINED SDL_SHARED_ENABLED_BY_DEFAULT) if (NOT DEFINED SDL_SHARED_ENABLED_BY_DEFAULT)
@@ -1518,6 +1520,8 @@ elseif(WINDOWS)
endif() endif()
set(HAVE_SDL_MISC TRUE) set(HAVE_SDL_MISC TRUE)
set(SDL_LINK_DIR ${PARENT_SCOPE})
# Check for DirectX # Check for DirectX
if(SDL_DIRECTX) if(SDL_DIRECTX)
if(DEFINED MSVC_VERSION AND NOT ${MSVC_VERSION} LESS 1700) if(DEFINED MSVC_VERSION AND NOT ${MSVC_VERSION} LESS 1700)
@@ -1550,6 +1554,8 @@ elseif(WINDOWS)
set(CMAKE_REQUIRED_FLAGS ${ORIG_CMAKE_REQUIRED_FLAGS}) set(CMAKE_REQUIRED_FLAGS ${ORIG_CMAKE_REQUIRED_FLAGS})
endif() endif()
link_directories(${SDL_LINK_DIR})
if(SDL_XINPUT) if(SDL_XINPUT)
# xinput.h may need windows.h, but does not include it itself. # xinput.h may need windows.h, but does not include it itself.
check_c_source_compiles(" check_c_source_compiles("
@@ -2766,6 +2772,13 @@ if(SDL_STATIC)
endif() endif()
endif() endif()
if(MEGA)
if(SDL_SHARED)
install(TARGETS SDL2 RUNTIME DESTINATION . LIBRARY DESTINATION .)
endif()
return()
endif()
##### Tests ##### ##### Tests #####
if(SDL_TEST) if(SDL_TEST)