UnitTests: make it possible to build tests for code that has global dependencies

This commit is contained in:
Pierre Bourdon
2014-08-01 23:23:52 -07:00
parent 226a9c2392
commit 8b26d7bf1e
9 changed files with 93 additions and 41 deletions

View File

@ -4,6 +4,9 @@ set(SRCS ControllerEmu.cpp
ControllerInterface/Device.cpp
ControllerInterface/ExpressionParser.cpp)
set(LIBS common)
if(WIN32)
set(SRCS ${SRCS}
ControllerInterface/DInput/DInput.cpp
@ -24,6 +27,7 @@ elseif(X11_FOUND)
set(SRCS ${SRCS}
ControllerInterface/Xlib/XInput2.cpp)
endif()
set(LIBS ${LIBS} ${X11_LIBRARIES} ${XINPUT2_LIBRARIES})
elseif(ANDROID)
set(SRCS ${SRCS}
ControllerInterface/Android/Android.cpp)
@ -31,6 +35,11 @@ endif()
if(SDL_FOUND OR SDL2_FOUND)
set(SRCS ${SRCS} ControllerInterface/SDL/SDL.cpp)
if (SDL2_FOUND)
set(LIBS ${LIBS} ${SDL2_LIBRARY})
elseif(SDL_FOUND)
set(LIBS ${LIBS} ${SDL_LIBRARY})
endif()
endif()
add_dolphin_library(inputcommon "${SRCS}" "")
add_dolphin_library(inputcommon "${SRCS}" "${LIBS}")