Commit 04437376 authored by Keith Packard's avatar Keith Packard Committed by Fabio Baltieri
Browse files

boards/posix: Handle SDL2 compile vars with multiple values



When transforming SDL2_LIBRARIES and SDL2_INCLUDE_DIRS into compile
options, each member needs to be preceeded by -l or -I. Use the cmake
list(TRANFORM) operation to prepend the flag to each list element instead
of just prepending the flag to the entire list.

Signed-off-by: default avatarKeith Packard <keithp@keithp.com>
parent 6564e8b7
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -12,8 +12,10 @@ if (CONFIG_NATIVE_APPLICATION)
	zephyr_include_directories(${SDL2_INCLUDE_DIRS})
	zephyr_compile_options(${SDL2_CFLAGS_OTHER})
else()
	target_link_options(native_simulator INTERFACE "-l${SDL2_LIBRARIES}")
	target_compile_options(native_simulator INTERFACE "-I${SDL2_INCLUDE_DIRS}" ${SDL2_CFLAGS_OTHER})
	list(TRANSFORM SDL2_LIBRARIES PREPEND "-l" OUTPUT_VARIABLE SDL2_LIBRARIES_OPTION)
	target_link_options(native_simulator INTERFACE "${SDL2_LIBRARIES_OPTION}")
	list(TRANSFORM SDL2_INCLUDE_DIRS PREPEND "-I" OUTPUT_VARIABLE SDL2_INCLUDE_DIRS_OPTION)
	target_compile_options(native_simulator INTERFACE "${SDL2_INCLUDE_DIRS_OPTION}" ${SDL2_CFLAGS_OTHER})
endif()

zephyr_library_sources(sdl_events.c)