Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 17, 2026

Addresses code review feedback from PR #875 requesting DRY refactoring of duplicated Rialto discovery logic in test/rialtoPOC/CMakeLists.txt.

Changes

  • Extracted find_and_configure_rialto() function containing Rialto dependency discovery logic (find_path, find_library, find_package_handle_standard_args, imported target creation)
  • Single discovery call before defining both rialtoPOC2 and rialtoPOC3 targets instead of duplicating 40 lines per target
  • Added PARENT_SCOPE to all set() calls within the function to propagate variables (RIALTO_LIBRARIES, RIALTO_INCLUDE_DIRS, RIALTO_FOUND) to parent scope
# Function to discover and configure Rialto dependencies
function(find_and_configure_rialto)
	find_path( RIALTO_INCLUDE_DIR NAMES IMediaPipeline.h PATH_SUFFIXES rialto)
	find_library( RIALTO_LIBRARY NAMES libRialtoClient.so RialtoClient )
	# ... discovery logic ...
	
	if( RIALTO_FOUND )
		set( RIALTO_LIBRARIES ${RIALTO_LIBRARY} PARENT_SCOPE )
		# ... other variables with PARENT_SCOPE ...
	endif()
endfunction()

# Call once, use for both targets
find_and_configure_rialto()

Follows existing CMake function patterns in codebase (aamp_utest_run_add, xcode_define_schema).


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: pstroffolino <20442081+pstroffolino@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix issues raised in PR #875 feedback Refactor duplicated Rialto discovery logic into reusable CMake function Jan 17, 2026
Copilot AI requested a review from pstroffolino January 17, 2026 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants