CMake: Define an interface target for SDL2 definitions
This commit is contained in:
parent
34b6c8bd88
commit
776cb91785
4 changed files with 11 additions and 8 deletions
|
@ -13,7 +13,6 @@ set(HEADERS
|
|||
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})
|
||||
|
@ -22,6 +21,6 @@ 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_link_libraries(input_common PRIVATE SDL2)
|
||||
target_compile_definitions(input_common PRIVATE HAVE_SDL2)
|
||||
endif()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue