Link to xcb as system-provided targets, instead of by direct library path (#4221)

Signed-off-by: Chris Burel <burelc@amazon.com>
This commit is contained in:
Chris Burel
2021-09-21 10:31:42 -07:00
committed by GitHub
parent 04ee676e2f
commit 19747cb5c6
3 changed files with 46 additions and 10 deletions
@@ -10,17 +10,12 @@
# Only 'xcb' and 'wayland' are recognized
if (${PAL_TRAIT_LINUX_WINDOW_MANAGER} STREQUAL "xcb")
find_library(XCB_LIBRARY xcb)
find_library(XCB_XKB_LIBRARY xcb-xkb)
find_library(XKBCOMMON_LIBRARY xkbcommon)
find_library(XKBCOMMON_X11_LIBRARY xkbcommon-x11)
set(LY_BUILD_DEPENDENCIES
PRIVATE
${XCB_LIBRARY}
${XKBCOMMON_LIBRARY}
${XKBCOMMON_X11_LIBRARY}
${XCB_XKB_LIBRARY}
3rdParty::X11::xcb
3rdParty::X11::xcb_xkb
3rdParty::X11::xkbcommon
3rdParty::X11::xkbcommon_X11
)
set(LY_COMPILE_DEFINITIONS PUBLIC PAL_TRAIT_LINUX_WINDOW_MANAGER_XCB)
+29
View File
@@ -0,0 +1,29 @@
#
# Copyright (c) Contributors to the Open 3D Engine Project.
# For complete copyright and license terms please see the LICENSE at the root of this distribution.
#
# SPDX-License-Identifier: Apache-2.0 OR MIT
#
#
# Open a new scope so we can make changes to CMAKE_MODULE_PATH, and restore it
# when we're done
function(FindX11)
# O3DE's FindX11.cmake is a wrapper for the one that CMake provides. Remove
# our current directory from CMAKE_MODULE_PATH to avoid recursive includes
list(REMOVE_ITEM CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR})
find_package(X11 COMPONENTS ${X11_FIND_COMPONENTS} QUIET)
foreach(component IN LISTS X11_FIND_COMPONENTS)
ly_add_external_target(
SYSTEM
PACKAGE X11
NAME ${component}
VERSION ""
BUILD_DEPENDENCIES
X11::${component}
)
endforeach()
endfunction()
FindX11()
+13 -1
View File
@@ -477,11 +477,23 @@ function(ly_parse_third_party_dependencies ly_THIRD_PARTY_LIBRARIES)
if(${dependency_namespace} STREQUAL "3rdParty")
if (NOT TARGET ${dependency})
list(GET dependency_list 1 dependency_package)
list(LENGTH dependency_list dependency_list_length)
ly_download_associated_package(${dependency_package})
find_package(${dependency_package} REQUIRED MODULE)
if (dependency_list_length GREATER 2)
# There's an optional interface specified
list(GET dependency_list 2 component)
list(APPEND packages_with_components ${dependency_package})
list(APPEND ${dependency_package}_components ${component})
else()
find_package(${dependency_package} REQUIRED MODULE)
endif()
endif()
endif()
endforeach()
foreach(dependency IN LISTS packages_with_components)
find_package(${dependency} REQUIRED MODULE COMPONENTS ${${dependency}_components})
endforeach()
endfunction()
#! ly_configure_target_platform_properties: Configures any platform specific properties on target