mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-02 20:24:32 +02:00
cmake: Only rewrite componend_depends.cmake if it changes
This commit is contained in:
committed by
Angus Gratton
parent
70288f864e
commit
48bd67524d
@@ -184,10 +184,10 @@ debug("components in build: ${build_component_paths}")
|
|||||||
debug("components not found: ${not_found}")
|
debug("components not found: ${not_found}")
|
||||||
|
|
||||||
function(line contents)
|
function(line contents)
|
||||||
file(APPEND "${DEPENDENCIES_FILE}" "${contents}\n")
|
file(APPEND "${DEPENDENCIES_FILE}.tmp" "${contents}\n")
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
file(WRITE "${DEPENDENCIES_FILE}" "# Component requirements generated by expand_requirements.cmake\n\n")
|
file(WRITE "${DEPENDENCIES_FILE}.tmp" "# Component requirements generated by expand_requirements.cmake\n\n")
|
||||||
line("set(BUILD_COMPONENTS ${build_components})")
|
line("set(BUILD_COMPONENTS ${build_components})")
|
||||||
line("set(BUILD_COMPONENT_PATHS ${build_component_paths})")
|
line("set(BUILD_COMPONENT_PATHS ${build_component_paths})")
|
||||||
line("")
|
line("")
|
||||||
@@ -216,3 +216,7 @@ endforeach()
|
|||||||
|
|
||||||
line(" message(FATAL_ERROR \"Component not found: \${component}\")")
|
line(" message(FATAL_ERROR \"Component not found: \${component}\")")
|
||||||
line("endfunction()")
|
line("endfunction()")
|
||||||
|
|
||||||
|
# only replace DEPENDENCIES_FILE if it has changed (prevents ninja/make build loops.)
|
||||||
|
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different "${DEPENDENCIES_FILE}.tmp" "${DEPENDENCIES_FILE}")
|
||||||
|
execute_process(COMMAND ${CMAKE_COMMAND} -E remove "${DEPENDENCIES_FILE}.tmp")
|
||||||
|
Reference in New Issue
Block a user