From: Charles Giessen Date: Fri, 13 Sep 2024 20:33:58 +0000 (-0500) Subject: Only add include paths for xcb, x11, & directfb instead of linking X-Git-Tag: upstream/1.3.296~7 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=49641613084d61f29452ed3cc4e4dbcb2448e457;p=platform%2Fupstream%2FVulkan-Loader.git Only add include paths for xcb, x11, & directfb instead of linking Previously, the loader linked to various windowing libraries but never made any calls into them. These can safely be removed, as including the libraries locations in the header search paths is sufficient. Because vulkan_core.h includes directfb.h without a path, it is necessary to add the search path found from pkg-config as well as the same path with `/directfb` appended to get vulkan_core.h to be able to find the header. This may be a bug in the vulkan_core.h or just an inconsistency with the way directfb is packaged on ubuntu 24, the system the change was developed on. --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 46217bce..800b953f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -118,21 +118,25 @@ elseif(CMAKE_SYSTEM_NAME MATCHES "Linux|BSD|DragonFly|GNU") if(BUILD_WSI_XCB_SUPPORT) pkg_check_modules(XCB REQUIRED QUIET IMPORTED_TARGET xcb) + pkg_get_variable(XCB_INCLUDE_DIRS xcb includedir) target_compile_definitions(platform_wsi INTERFACE VK_USE_PLATFORM_XCB_KHR) - target_link_libraries(platform_wsi INTERFACE PkgConfig::XCB) + target_include_directories(platform_wsi INTERFACE ${XCB_INCLUDE_DIRS}) endif() if(BUILD_WSI_XLIB_SUPPORT) pkg_check_modules(X11 REQUIRED QUIET IMPORTED_TARGET x11) + pkg_get_variable(XLIB_INCLUDE_DIRS x11 includedir) target_compile_definitions(platform_wsi INTERFACE VK_USE_PLATFORM_XLIB_KHR VK_USE_PLATFORM_XLIB_XRANDR_EXT) - target_link_libraries(platform_wsi INTERFACE PkgConfig::X11) + target_include_directories(platform_wsi INTERFACE ${XLIB_INCLUDE_DIRS}) endif() if(BUILD_WSI_WAYLAND_SUPPORT) target_compile_definitions(platform_wsi INTERFACE VK_USE_PLATFORM_WAYLAND_KHR) endif() if(BUILD_WSI_DIRECTFB_SUPPORT) pkg_check_modules(DirectFB QUIET REQUIRED IMPORTED_TARGET directfb) + pkg_get_variable(DIRECTFB_INCLUDE_DIRS directfb includedir) target_compile_definitions(platform_wsi INTERFACE VK_USE_PLATFORM_DIRECTFB_EXT) - target_link_libraries(platform_wsi INTERFACE PkgConfig::DirectFB) + # vulkan_core.h includes but the header is installed to directfb/directfb.h + target_include_directories(platform_wsi INTERFACE ${DIRECTFB_INCLUDE_DIRS} ${DIRECTFB_INCLUDE_DIRS}/directfb) endif() elseif(CMAKE_SYSTEM_NAME MATCHES "QNX") message(FATAL_ERROR "See BUILD.md for QNX build")