Commit f9fbd6cc authored by Ghislain MARY's avatar Ghislain MARY

Prevent multiple inclusions of builders.

parent c46487ad
......@@ -49,6 +49,7 @@ include(cmake/CheckBuildTools.cmake)
set(LINPHONE_BUILDER_EP_VARS)
set(LINPHONE_BUILDER_INCLUDED_BUILDERS)
set(LINPHONE_BUILDER_INCLUDED_BUILDERS_TO_EXCLUDE)
set(LINPHONE_BUILDER_EXTERNAL_SOURCE_PATH_BUILDERS)
macro(linphone_builder_expand_external_project_vars)
......@@ -205,7 +206,7 @@ macro(linphone_builder_add_builder_to_target TARGETNAME BUILDER)
endif()
unset(_already_included)
elseif(LINPHONE_BUILDER_BUILD_ONLY_EXTERNAL_SOURCE_PATH)
list(REMOVE_ITEM LINPHONE_BUILDER_INCLUDED_BUILDERS ${BUILDER})
list(APPEND LINPHONE_BUILDER_INCLUDED_BUILDERS_TO_EXCLUDE ${BUILDER})
else()
message(STATUS "${TARGETNAME} depends on external project EP_${BUILDER}")
add_dependencies(${TARGETNAME} EP_${BUILDER})
......@@ -365,9 +366,10 @@ macro(linphone_builder_filter_out_inexistent_dependencies PROJNAME)
foreach(_dep ${EP_${PROJNAME}_DEPENDENCIES})
string(REGEX REPLACE "^EP_" "" _dep2 ${_dep})
list(FIND LINPHONE_BUILDER_INCLUDED_BUILDERS ${_dep2} _found)
list(FIND LINPHONE_BUILDER_INCLUDED_BUILDERS_TO_EXCLUDE ${_dep2} _excluded_found)
list(FIND LINPHONE_BUILDER_EXTERNAL_SOURCE_PATH_BUILDERS ${_dep2} _external_source_path_found)
message("_dep: ${_dep2} _found: ${_found} _external_source_path_found: ${_external_source_path_found}")
if(_found GREATER -1 AND _external_source_path_found EQUAL -1)
if(_found GREATER -1 AND _excluded_found EQUAL -1 AND _external_source_path_found EQUAL -1)
list(APPEND _new_deps ${_dep})
endif()
endforeach()
......@@ -607,8 +609,9 @@ function(linphone_builder_add_external_projects)
message("LINPHONE_BUILDER_INCLUDED_BUILDERS: ${LINPHONE_BUILDER_INCLUDED_BUILDERS}")
message("LINPHONE_BUILDER_EXTERNAL_SOURCE_PATH_BUILDERS: ${LINPHONE_BUILDER_EXTERNAL_SOURCE_PATH_BUILDERS}")
foreach(BUILDER ${LINPHONE_BUILDER_INCLUDED_BUILDERS})
list(FIND LINPHONE_BUILDER_EXTERNAL_SOURCE_PATH_BUILDERS ${BUILDER} _found)
if((_found EQUAL -1) OR (NOT LINPHONE_BUILDER_GROUP_EXTERNAL_SOURCE_PATH_BUILDERS))
list(FIND LINPHONE_BUILDER_INCLUDED_BUILDERS_TO_EXCLUDE ${BUILDER} _excluded_found)
list(FIND LINPHONE_BUILDER_EXTERNAL_SOURCE_PATH_BUILDERS ${BUILDER} _external_source_path_found)
if((_excluded_found EQUAL -1) AND ((_external_source_path_found EQUAL -1) OR (NOT LINPHONE_BUILDER_GROUP_EXTERNAL_SOURCE_PATH_BUILDERS)))
linphone_builder_add_external_project(${BUILDER})
endif()
endforeach()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment