[evolution-data-server/gnome-3-30] Make sure intltool-merge cache is created only once



commit 47a2c0852de8aa7fbc7ed8ed9f82f9107972972a
Author: Milan Crha <mcrha redhat com>
Date:   Tue Oct 30 15:45:00 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 2cda2549e..8e223e9d7 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]