[evolution] Make sure intltool-merge cache is created only once



commit f315ca6a601e77220323bff4ac7782b54c862a0c
Author: Milan Crha <mcrha redhat com>
Date:   Tue Oct 30 15:50:58 2018 +0100

    Make sure intltool-merge cache is created only once
    
    Similar to https://gitlab.gnome.org/GNOME/evolution/issues/196
    when intltool-merge is called in parallel, it could either rewrite
    the ongoing attempt to build it or use an incomplete data, which
    results in broken output files (.desktop, .metainfo and so on).
    This change ensures the intltool-merge cache is created only once
    and any other requests which would use it will wait until it's created.

 cmake/modules/FindIntltool.cmake | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
---
diff --git a/cmake/modules/FindIntltool.cmake b/cmake/modules/FindIntltool.cmake
index 2cda2549eb..8e223e9d7f 100644
--- a/cmake/modules/FindIntltool.cmake
+++ b/cmake/modules/FindIntltool.cmake
@@ -176,9 +176,18 @@ macro(intltool_merge _in_filename _out_filename)
                        DEPENDS ${_in}
                )
        else(_has_no_translations)
+               if(NOT TARGET intltool-merge-cache)
+                       add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/po/.intltool-merge-cache
+                               COMMAND ${INTLTOOL_MERGE} ${_args} --quiet 
--cache="${CMAKE_BINARY_DIR}/po/.intltool-merge-cache" "${GETTEXT_PO_DIR}" "${_in}" "${_out}"
+                               DEPENDS ${_in}
+                       )
+                       add_custom_target(intltool-merge-cache ALL
+                               DEPENDS ${CMAKE_BINARY_DIR}/po/.intltool-merge-cache)
+               endif(NOT TARGET intltool-merge-cache)
+
                add_custom_command(OUTPUT ${_out}
                        COMMAND ${INTLTOOL_MERGE} ${_args} --quiet 
--cache="${CMAKE_BINARY_DIR}/po/.intltool-merge-cache" "${GETTEXT_PO_DIR}" "${_in}" "${_out}"
-                       DEPENDS ${_in}
+                       DEPENDS ${_in} intltool-merge-cache
                )
        endif(_has_no_translations)
 endmacro(intltool_merge)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]