mirror of
https://github.com/love2d/megasource.git
synced 2026-08-17 19:24:09 +02:00
Add SDL2 to main CMakeLists.txt.
Also expose SDL_LINK_DIR. This is required because the main target inherits some of SDL2 extra dependcies (DirectX) for some reason.
This commit is contained in:
@@ -756,7 +756,9 @@ elseif(WINDOWS)
|
||||
if(HAVE_D3D_H OR HAVE_DDRAW_H OR HAVE_DSOUND_H OR HAVE_DINPUT_H OR HAVE_XAUDIO2_H)
|
||||
set(HAVE_DIRECTX TRUE)
|
||||
# TODO: change $ENV{DXSDL_DIR} to get the path from the include checks
|
||||
link_directories($ENV{DXSDK_DIR}\\lib\\${PROCESSOR_ARCH})
|
||||
set(SDL_LINK_DIR $ENV{DXSDK_DIR}\\lib\\${PROCESSOR_ARCH})
|
||||
set(SDL_LINK_DIR ${SDL_LINK_DIR} PARENT_SCOPE)
|
||||
link_directories(${SDL_LINK_DIR})
|
||||
include_directories($ENV{DXSDK_DIR}\\Include)
|
||||
endif()
|
||||
set(CMAKE_REQUIRED_FLAGS)
|
||||
@@ -1159,6 +1161,7 @@ if(SDL_SHARED)
|
||||
endif(UNIX)
|
||||
set(_INSTALL_LIBS "SDL2" ${_INSTALL_LIBS})
|
||||
target_link_libraries(SDL2 ${EXTRA_LIBS} ${EXTRA_LDFLAGS})
|
||||
target_include_directories(SDL2 PUBLIC include)
|
||||
endif(SDL_SHARED)
|
||||
|
||||
if(SDL_STATIC)
|
||||
@@ -1168,6 +1171,7 @@ if(SDL_STATIC)
|
||||
# libraries - do we need to consider this?
|
||||
set(_INSTALL_LIBS "SDL2-static" ${_INSTALL_LIBS})
|
||||
target_link_libraries(SDL2-static ${EXTRA_LIBS} ${EXTRA_LDFLAGS})
|
||||
target_include_directories(SDL2-static PUBLIC include)
|
||||
endif(SDL_STATIC)
|
||||
|
||||
##### Installation targets #####
|
||||
|
||||
Reference in New Issue
Block a user