From c533975dc2659baaf7e9c9c315c9f7f532f67366 Mon Sep 17 00:00:00 2001
From: Roman Tsisyk <roman@tarantool.org>
Date: Thu, 20 Jul 2017 11:08:27 +0300
Subject: [PATCH] Fix autogeneration of module.h

Now module.h is autogenerated automatically on `make all`
if one or more source header files have changed.

Closes #2481
---
 cmake/module.cmake | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/cmake/module.cmake b/cmake/module.cmake
index 73bf2eb4e4..988dcb94da 100644
--- a/cmake/module.cmake
+++ b/cmake/module.cmake
@@ -31,12 +31,14 @@ function(rebuild_module_api)
         COMMAND cat ${CMAKE_CURRENT_SOURCE_DIR}/module_footer.h >> ${tmpfile}
         COMMAND ${CMAKE_COMMAND} -E copy_if_different ${tmpfile} ${dstfile}
         COMMAND ${CMAKE_COMMAND} -E remove ${errcodefile} ${tmpfile}
-        DEPENDS ${srcfiles} ${CMAKE_SOURCE_DIR}/src/box/errcode.h
+        DEPENDS ${CMAKE_SOURCE_DIR}/extra/apigen
                 ${CMAKE_CURRENT_SOURCE_DIR}/module_header.h
                 ${CMAKE_CURRENT_SOURCE_DIR}/module_footer.h
+                ${CMAKE_SOURCE_DIR}/src/box/errcode.h
+                ${headers}
         )
 
-    add_custom_target(api ALL DEPENDS ${srcfiles} ${dstfile})
+    add_custom_target(api ALL DEPENDS ${dstfile})
     install(FILES ${dstfile} DESTINATION ${MODULE_INCLUDEDIR})
 endfunction()
 set_source_files_properties("${CMAKE_CURRENT_BINARY_DIR}/module.h" PROPERTIES GENERATED HEADER_FILE_ONLY)
-- 
GitLab