Merge pull request #6625 from lioncash/evdev-udev
InputCommon/CMakeLists: Include evdev and udev includes on a by-target basis
This commit is contained in:
commit
b1bbd8a50e
|
@ -491,7 +491,6 @@ if(ENABLE_EVDEV)
|
||||||
message(STATUS "libevdev/libudev found, enabling evdev controller backend")
|
message(STATUS "libevdev/libudev found, enabling evdev controller backend")
|
||||||
add_definitions(-DHAVE_LIBUDEV=1)
|
add_definitions(-DHAVE_LIBUDEV=1)
|
||||||
add_definitions(-DHAVE_LIBEVDEV=1)
|
add_definitions(-DHAVE_LIBEVDEV=1)
|
||||||
include_directories(${LIBUDEV_INCLUDE_DIR} ${LIBEVDEV_INCLUDE_DIR})
|
|
||||||
else()
|
else()
|
||||||
message(FATAL_ERROR "Couldn't find libevdev and/or libudev. Can't build evdev controller backend.\nDisable ENABLE_EVDEV if you wish to build without controller support")
|
message(FATAL_ERROR "Couldn't find libevdev and/or libudev. Can't build evdev controller backend.\nDisable ENABLE_EVDEV if you wish to build without controller support")
|
||||||
endif()
|
endif()
|
||||||
|
|
|
@ -74,10 +74,17 @@ else()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(LIBEVDEV_FOUND AND LIBUDEV_FOUND)
|
if(LIBEVDEV_FOUND AND LIBUDEV_FOUND)
|
||||||
target_sources(inputcommon PRIVATE
|
target_sources(inputcommon
|
||||||
|
PRIVATE
|
||||||
ControllerInterface/evdev/evdev.cpp
|
ControllerInterface/evdev/evdev.cpp
|
||||||
)
|
)
|
||||||
target_link_libraries(inputcommon PUBLIC
|
target_include_directories(inputcommon
|
||||||
|
PRIVATE
|
||||||
|
${LIBEVDEV_INCLUDE_DIR}
|
||||||
|
${LIBUDEV_INCLUDE_DIR}
|
||||||
|
)
|
||||||
|
target_link_libraries(inputcommon
|
||||||
|
PRIVATE
|
||||||
${LIBEVDEV_LIBRARY}
|
${LIBEVDEV_LIBRARY}
|
||||||
${LIBUDEV_LIBRARY}
|
${LIBUDEV_LIBRARY}
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue