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

@ -48,6 +48,11 @@ if(WIN32)
set(SRCS ${SRCS} ExtendedTrace.cpp)
endif(WIN32)
set(LIBS "${CMAKE_THREAD_LIBS_INIT}")
if((NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin") AND (NOT ANDROID))
set(LIBS ${LIBS} rt)
endif()
enable_precompiled_headers(stdafx.h stdafx.cpp SRCS)
add_dolphin_library(common "${SRCS}" "${CMAKE_THREAD_LIBS_INIT}")
add_dolphin_library(common "${SRCS}" "${LIBS}")

View File

@ -221,7 +221,18 @@ if(_M_ARM_32)
)
endif()
set(LIBS bdisasm inputcommon videoogl videosoftware sfml-network)
set(LIBS
audiocommon
bdisasm
common
discio
inputcommon
${LZO}
sfml-network
videoogl
videosoftware
z
)
if(LIBUSB_FOUND)
# Using shared LibUSB
@ -236,6 +247,8 @@ if(WIN32)
HW/WiimoteReal/IOWin.cpp)
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(SRCS ${SRCS} HW/BBA-TAP/TAP_Apple.cpp HW/WiimoteReal/IOdarwin.mm)
set(LIBS ${LIBS}
${IOB_LIBRARY})
elseif(UNIX)
set(SRCS ${SRCS} HW/BBA-TAP/TAP_Unix.cpp)
if((${CMAKE_SYSTEM_NAME} MATCHES "Linux") AND BLUEZ_FOUND)

View File

@ -4,41 +4,17 @@ endif()
set(LIBS core
${LZO}
discio
bdisasm
inputcommon
common
audiocommon
z
sfml-network
${GTK2_LIBRARIES})
if((NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin") AND (NOT ANDROID))
set(LIBS ${LIBS} rt)
endif()
if(NOT ANDROID)
if(USE_X11)
set(LIBS ${LIBS} ${X11_LIBRARIES}
${XINPUT2_LIBRARIES}
${XRANDR_LIBRARIES})
set(LIBS ${LIBS} ${XRANDR_LIBRARIES})
endif()
if(USE_WAYLAND)
set(LIBS ${LIBS} ${WAYLAND_LIBRARIES}
${XKBCOMMON_LIBRARIES})
set(LIBS ${LIBS} ${WAYLAND_LIBRARIES} ${XKBCOMMON_LIBRARIES})
endif()
link_directories(${CMAKE_PREFIX_PATH}/lib)
if(SDL2_FOUND)
# Using shared SDL2
set(LIBS ${LIBS} ${SDL2_LIBRARY})
else(SDL2_FOUND)
if(SDL_FOUND)
# Using shared SDL
set(LIBS ${LIBS} ${SDL_LIBRARY})
endif()
endif()
else()
set(LIBS ${LIBS} png iconv)
endif()
@ -135,7 +111,6 @@ elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
${COREAUDIO_LIBRARY}
${COREFUND_LIBRARY}
${CORESERV_LIBRARY}
${IOB_LIBRARY}
${IOK_LIBRARY}
${FORCEFEEDBACK}
)

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}")