Commit 479521bb authored by Ghislain MARY's avatar Ghislain MARY

Replace check_changes step that is too slow by a step to force re-run of build step.

parent 96588471
......@@ -626,26 +626,13 @@ function(linphone_builder_add_external_project PROJNAME)
else()
set(_source_dirs ${EP_${PROJNAME}_SOURCE_DIR})
endif()
ExternalProject_Add_Step(EP_${PROJNAME} check_changes
COMMENT "Checking for source code changes for 'EP_${PROJNAME}'"
DEPENDEES update patch
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
ExternalProject_Add_Step(EP_${PROJNAME} force_build
COMMENT "Forcing build for 'EP_${PROJNAME}'"
DEPENDEES configure
DEPENDERS build
ALWAYS 1
)
_ep_get_step_stampfile(EP_${PROJNAME} check_changes _stamp_file) # Private API of ExternalProject module
add_custom_command(OUTPUT "${ep_build}/check_changes.txt"
COMMAND ${CMAKE_COMMAND} -DSOURCE_DIRS=${_source_dirs} -DBINARY_DIR=${ep_build} -P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/check_changes.cmake
DEPENDS ${_stamp_file}
)
# TODO: ExternalProject_Add_StepDependencies is available only from CMake 3.2
#ExternalProject_Add_StepDependencies(EP_${PROJNAME} configure "${ep_build}/check_changes.txt")
_ep_get_step_stampfile(EP_${PROJNAME} configure _stamp_file) # Private API of ExternalProject module
add_custom_command(APPEND
OUTPUT ${_stamp_file}
DEPENDS "${ep_build}/check_changes.txt"
)
unset(_source_dirs)
unset(_stamp_file)
endif()
endfunction()
......
cmake_policy(SET CMP0009 NEW)
set(CHANGES "")
foreach(SOURCE_DIR ${SOURCE_DIRS})
file(GLOB_RECURSE SOURCE_FILES LIST_DIRECTORIES false RELATIVE "${SOURCE_DIR}" "${SOURCE_DIR}/*")
foreach(SOURCE_FILE ${SOURCE_FILES})
file(TIMESTAMP "${SOURCE_DIR}/${SOURCE_FILE}" SOURCE_FILE_TIMESTAMP UTC)
set(CHANGES "${CHANGES}${SOURCE_FILE}\t${SOURCE_FILE_TIMESTAMP}\n")
endforeach()
endforeach()
if(EXISTS "${BINARY_DIR}/check_changes.txt")
file(READ "${BINARY_DIR}/check_changes.txt" OLD_CHANGES)
if(NOT CHANGES STREQUAL OLD_CHANGES)
file(WRITE "${BINARY_DIR}/check_changes.txt" "${CHANGES}")
endif()
else()
file(WRITE "${BINARY_DIR}/check_changes.txt" "${CHANGES}")
endif()
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