mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
23 lines
571 B
CMake
23 lines
571 B
CMake
function(list_subtract lhs rhs result_var_name)
|
|
set(result)
|
|
foreach(item IN LISTS lhs)
|
|
list(FIND rhs "${item}" index)
|
|
if(${index} EQUAL -1)
|
|
list(APPEND result "${item}")
|
|
endif()
|
|
endforeach()
|
|
set("${result_var_name}" "${result}" PARENT_SCOPE)
|
|
endfunction()
|
|
|
|
function(list_intersect lhs rhs result_var_name)
|
|
set(result)
|
|
foreach(item IN LISTS lhs)
|
|
list(FIND rhs "${item}" index)
|
|
if(NOT ${index} EQUAL -1)
|
|
list(APPEND result "${item}")
|
|
endif()
|
|
endforeach()
|
|
set("${result_var_name}" "${result}" PARENT_SCOPE)
|
|
endfunction()
|
|
|