From d63d0b5069dbbe9f9377624cd7849d2d3f74d454 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 10 Apr 2018 09:33:00 -0400 Subject: [PATCH 1/2] InputCommon/CMakeLists: Include evdev and udev includes on a by-target basis Avoids including the evdev/udev includes in the top-level directory --- CMakeLists.txt | 1 - Source/Core/InputCommon/CMakeLists.txt | 5 +++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f9d18f1cad..947fcd339b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -491,7 +491,6 @@ if(ENABLE_EVDEV) message(STATUS "libevdev/libudev found, enabling evdev controller backend") add_definitions(-DHAVE_LIBUDEV=1) add_definitions(-DHAVE_LIBEVDEV=1) - include_directories(${LIBUDEV_INCLUDE_DIR} ${LIBEVDEV_INCLUDE_DIR}) 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") endif() diff --git a/Source/Core/InputCommon/CMakeLists.txt b/Source/Core/InputCommon/CMakeLists.txt index 704ef394bf..6e44880a07 100644 --- a/Source/Core/InputCommon/CMakeLists.txt +++ b/Source/Core/InputCommon/CMakeLists.txt @@ -77,6 +77,11 @@ if(LIBEVDEV_FOUND AND LIBUDEV_FOUND) target_sources(inputcommon PRIVATE ControllerInterface/evdev/evdev.cpp ) + target_include_directories(inputcommon + PRIVATE + ${LIBEVDEV_INCLUDE_DIR} + ${LIBUDEV_INCLUDE_DIR} + ) target_link_libraries(inputcommon PUBLIC ${LIBEVDEV_LIBRARY} ${LIBUDEV_LIBRARY} From 73ebc190fae87bf6009daa336a08d30bfc56576b Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 10 Apr 2018 09:53:08 -0400 Subject: [PATCH 2/2] InputCommon/CMakeLists: Link evdev and udev in privately These libraries aren't directly used outside of InputCommon --- Source/Core/InputCommon/CMakeLists.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Source/Core/InputCommon/CMakeLists.txt b/Source/Core/InputCommon/CMakeLists.txt index 6e44880a07..b79d9fef19 100644 --- a/Source/Core/InputCommon/CMakeLists.txt +++ b/Source/Core/InputCommon/CMakeLists.txt @@ -74,7 +74,8 @@ else() endif() if(LIBEVDEV_FOUND AND LIBUDEV_FOUND) - target_sources(inputcommon PRIVATE + target_sources(inputcommon + PRIVATE ControllerInterface/evdev/evdev.cpp ) target_include_directories(inputcommon @@ -82,7 +83,8 @@ if(LIBEVDEV_FOUND AND LIBUDEV_FOUND) ${LIBEVDEV_INCLUDE_DIR} ${LIBUDEV_INCLUDE_DIR} ) - target_link_libraries(inputcommon PUBLIC + target_link_libraries(inputcommon + PRIVATE ${LIBEVDEV_LIBRARY} ${LIBUDEV_LIBRARY} )