From 8ba74d06c60a6040a4ad008a7b4ee66d18ea7317 Mon Sep 17 00:00:00 2001 From: Benign X <1341398182@qq.com> Date: Sat, 27 Jan 2024 13:40:43 +0800 Subject: [PATCH] arch/sim: fix X11 compile failed --- arch/sim/src/sim/CMakeLists.txt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/arch/sim/src/sim/CMakeLists.txt b/arch/sim/src/sim/CMakeLists.txt index 9653f13db0..ff92692182 100644 --- a/arch/sim/src/sim/CMakeLists.txt +++ b/arch/sim/src/sim/CMakeLists.txt @@ -166,7 +166,12 @@ endif() if(CONFIG_SIM_X11FB) list(APPEND HOSTSRCS sim_x11framebuffer.c) - list(APPEND STDLIBS X11 Xext) + + find_package(X11 REQUIRED) + if(X11_FOUND) + target_include_directories(nuttx PRIVATE ${X11_INCLUDE_DIR}) + target_link_libraries(nuttx PRIVATE ${X11_LIBRARIES}) + endif() if(CONFIG_SIM_TOUCHSCREEN) list(APPEND SRCS sim_touchscreen.c)