-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add the unified PlatformGraphics module, which looks for either Integrity or VxWorks platform graphics. The PlatformGraphics module creates the interface PlatformGraphics::PlatformGraphics target which links the respective platform graphics target. It's expected that from the platform graphics targets to deliver the consistent subset of definitions, libraries, include directories, compiler and linker flags and also the special <platform>_REQUIRED_<LIBRARIES|INCLUDES|DEFINITIONS> variables. The <platform>_REQUIRED_<LIBRARIES|INCLUDES|DEFINITIONS> variables are consumed by the PlatformGraphics::PlatformGraphics and stored in the respective _qt_internal_platform_graphics_required_<type> property, to access the value without scope limitations. The property then is checked by the EGL and GLESv2 modules(this can be done elsewhere too) and is appended to the CMAKE_REQUIRED_<type> variable before running the respective compiler checks. Task-number: QTBUG-128455 Change-Id: Id1987c6294327509a14fbeeb7b8bf39aad6f486c Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Karim Pinter <karim.pinter@qt.io> (cherry picked from commit 3322f58)
- Loading branch information
Showing
8 changed files
with
133 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
# Copyright (C) 2024 The Qt Company Ltd. | ||
# SPDX-License-Identifier: BSD-3-Clause | ||
|
||
#.rst: | ||
# PlatformGraphics | ||
# --------- | ||
|
||
if(INTEGRITY) | ||
set(platform Integrity) | ||
elseif(VXWORKS) | ||
set(platform VxWorks) | ||
else() | ||
set(PlatformGraphics_FOUND FALSE) | ||
return() | ||
endif() | ||
|
||
find_package(${platform}PlatformGraphics) | ||
|
||
set(platform_target ${platform}PlatformGraphics::${platform}PlatformGraphics) | ||
if(NOT ${platform}PlatformGraphics_FOUND OR | ||
NOT TARGET ${platform_target}) | ||
set(PlatformGraphics_FOUND FALSE) | ||
return() | ||
endif() | ||
|
||
if(NOT TARGET PlatformGraphics::PlatformGraphics) | ||
add_library(PlatformGraphics::PlatformGraphics INTERFACE IMPORTED) | ||
target_link_libraries(PlatformGraphics::PlatformGraphics INTERFACE ${platform_target}) | ||
|
||
# The list of libraries that are required to pass the EGL/OpenGL/GLESv2 | ||
# compile checks. The list might or might not be provided by platforms or | ||
# toolchain files. | ||
foreach(known_var LIBRARIES INCLUDES DEFINITIONS) | ||
string(TOLOWER "${known_var}" known_var_lc) | ||
if(${platform}PlatformGraphics_REQUIRED_${known_var}) | ||
set_property(TARGET PlatformGraphics::PlatformGraphics PROPERTY | ||
_qt_internal_platform_graphics_required_${known_var_lc} | ||
"${${platform}PlatformGraphics_REQUIRED_${known_var}}" | ||
) | ||
endif() | ||
endforeach() | ||
unset(known_var) | ||
unset(known_var_lc) | ||
endif() | ||
|
||
function(platform_graphics_extend_check_cxx_source_required_variables) | ||
foreach(known_var LIBRARIES INCLUDES DEFINITIONS) | ||
string(TOLOWER "${known_var}" known_var_lc) | ||
get_target_property(platform_graphics_required_${known_var_lc} | ||
PlatformGraphics::PlatformGraphics | ||
_qt_internal_platform_graphics_required_${known_var_lc} | ||
) | ||
if(platform_graphics_required_${known_var_lc}) | ||
list(APPEND CMAKE_REQUIRED_${known_var} ${platform_graphics_required_${known_var_lc}}) | ||
set(CMAKE_REQUIRED_${known_var} "${CMAKE_REQUIRED_${known_var}}" PARENT_SCOPE) | ||
endif() | ||
endforeach() | ||
endfunction() | ||
|
||
unset(platform) | ||
unset(platform_target) | ||
|
||
set(PlatformGraphics_FOUND TRUE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Copyright (C) 2024 The Qt Company Ltd. | ||
# SPDX-License-Identifier: BSD-3-Clause | ||
|
||
#.rst: | ||
# VxWorksPlatformGraphics | ||
# --------- | ||
find_package_handle_standard_args(VxWorksPlatformGraphics | ||
FOUND_VAR | ||
VxWorksPlatformGraphics_FOUND | ||
REQUIRED_VARS | ||
VxWorksPlatformGraphics_LIBRARIES_PACK | ||
VxWorksPlatformGraphics_REQUIRED_LIBRARIES | ||
) | ||
|
||
if(VxWorksPlatformGraphics_FOUND | ||
AND NOT TARGET VxWorksPlatformGraphics::VxWorksPlatformGraphics) | ||
add_library(VxWorksPlatformGraphics::VxWorksPlatformGraphics INTERFACE IMPORTED) | ||
set_target_properties(VxWorksPlatformGraphics::VxWorksPlatformGraphics PROPERTIES | ||
INTERFACE_INCLUDE_DIRECTORIES "${VxWorksPlatformGraphics_INCLUDE_DIR}" | ||
INTERFACE_LINK_LIBRARIES "${VxWorksPlatformGraphics_LIBRARIES_PACK}" | ||
INTERFACE_COMPILE_DEFINITIONS "${VxWorksPlatformGraphics_DEFINES}" | ||
) | ||
set(VxWorksPlatformGraphics_REQUIRED_DEFINITIONS ${VxWorksPlatformGraphics_DEFINES}) | ||
endif() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters