From 734c5cd421a654146f03dc947afed5d4a368d810 Mon Sep 17 00:00:00 2001 From: Joel Bodenmann Date: Thu, 28 Oct 2021 16:15:02 +0200 Subject: [PATCH] cmake: Improve SDL driver integration --- cmake/target_setup.cmake | 6 ++++++ drivers/multiple/SDL/driver.cmake | 12 ++++-------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/cmake/target_setup.cmake b/cmake/target_setup.cmake index 0dd7a4b2..15cdad23 100644 --- a/cmake/target_setup.cmake +++ b/cmake/target_setup.cmake @@ -18,4 +18,10 @@ function(ugfx_target_setup TARGET) ${ugfx_DEFS} ) + target_link_libraries( + ${TARGET} + PRIVATE + ${ugfx_LIBS} + ) + endfunction() diff --git a/drivers/multiple/SDL/driver.cmake b/drivers/multiple/SDL/driver.cmake index 0f88e07d..9dae16d0 100644 --- a/drivers/multiple/SDL/driver.cmake +++ b/drivers/multiple/SDL/driver.cmake @@ -12,17 +12,13 @@ list(APPEND ugfx_DEFS GFX_OS_PRE_INIT_FUNCTION=sdl_driver_init ) +list(APPEND ugfx_LIBS + SDL2::SDL2 +) + # Find SDL2 find_package( SDL2 REQUIRED ) -# Setup target -function(ugfx_driver_setup_SDL TARGET) - target_link_libraries( - ${TARGET} - PRIVATE - SDL2::SDL2 - ) -endfunction()