Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SFML dependency wrapper code cleanup #551

Merged
merged 1 commit into from
Dec 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CMake/Backends.cmake
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#[[
Details about sample backends, their source code files and linking requirements

Everytime a new backend gets added or its target name is modified, please update
Every time a new backend gets added or its target name is modified, please update
the list of available backends found in OptionsLists.cmake

This file is not meant to be used by consumers of the library, only by the RmlUi CMake project
Expand Down Expand Up @@ -114,7 +114,7 @@ target_sources(rmlui_backend_SFML_GL2 INTERFACE
"${PROJECT_SOURCE_DIR}/Backends/RmlUi_Renderer_GL2.h"
)
target_link_libraries(rmlui_backend_SFML_GL2 INTERFACE
rmlui_backend_common_headers OpenGL::GL rmlui_SFML_old_wrapper SFML::Graphics SFML::Window SFML::System
rmlui_backend_common_headers OpenGL::GL SFML::Graphics SFML::Window SFML::System
)

add_library(rmlui_backend_GLFW_GL2 INTERFACE)
Expand Down
14 changes: 5 additions & 9 deletions CMake/BackendsDependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -134,11 +134,11 @@ if(RMLUI_SAMPLES_BACKEND MATCHES "^SFML")
]]

# For each SFML component the project requires
foreach(sfml_component ${RMLUI_SFML_REQUIRED_COMPONENTS})
foreach(rmlui_sfml_component ${RMLUI_SFML_REQUIRED_COMPONENTS})
# Make the component name lowercase
string(TOLOWER ${sfml_component} sfml_component_lower)
string(TOLOWER ${rmlui_sfml_component} rmlui_sfml_component_lower)

if(TARGET sfml-${sfml_component_lower})
if(TARGET sfml-${rmlui_sfml_component_lower})
#[[
RMLUI_CMAKE_MINIMUM_VERSION_RAISE_NOTICE:
Because the target CMake version is 3.10, we can't alias non-global targets nor global imported targets.
Expand All @@ -150,14 +150,10 @@ if(RMLUI_SAMPLES_BACKEND MATCHES "^SFML")
]]

# If the target exists, alias it
add_library(SFML::${sfml_component} INTERFACE IMPORTED)
target_link_libraries(SFML::${sfml_component} INTERFACE sfml-${sfml_component_lower})
add_library(SFML::${rmlui_sfml_component} INTERFACE IMPORTED)
target_link_libraries(SFML::${rmlui_sfml_component} INTERFACE sfml-${rmlui_sfml_component_lower})
endif()
endforeach()

# Because module-specific targets already exist, there's no need for the wrapper for the older find module
# Set up wrapper target as dumb target
add_library(rmlui_SFML_old_wrapper INTERFACE)
endif()
endif()

Expand Down