Files
swift-mirror/cmake/modules/SwiftList.cmake
Dmitri Hrybenko 6670bb76ec Rewrite the CMake build system
Swift SVN r24124
2014-12-23 22:15:30 +00:00

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()