suyu/src/input_common/CMakeLists.txt
Yuri Kunde Schlesner 7b81903756 CMake: Correct inter-module dependencies and library visibility
Modules didn't correctly define their dependencies before, which relied
on the frontends implicitly including every module for linking to
succeed.

Also changed every target_link_libraries call to specify visibility of
dependencies to avoid leaking definitions to dependents when not
necessary.
2017-05-27 18:41:24 -07:00

28 lines
659 B
CMake

set(SRCS
analog_from_button.cpp
keyboard.cpp
main.cpp
)
set(HEADERS
analog_from_button.h
keyboard.h
main.h
)
if(SDL2_FOUND)
set(SRCS ${SRCS} sdl/sdl.cpp)
set(HEADERS ${HEADERS} sdl/sdl.h)
include_directories(${SDL2_INCLUDE_DIR})
endif()
create_directory_groups(${SRCS} ${HEADERS})
add_library(input_common STATIC ${SRCS} ${HEADERS})
target_link_libraries(input_common PUBLIC core PRIVATE common)
if(SDL2_FOUND)
target_link_libraries(input_common PRIVATE ${SDL2_LIBRARY})
target_compile_definitions(input_common PRIVATE HAVE_SDL2)
endif()