File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -48,6 +48,11 @@ function(_swift_generate_cxx_header target header)
4848 cmake_path(APPEND base_path ${header}
4949 OUTPUT_VARIABLE header_path)
5050
51+ # Work out the name of the .d file that swiftc will emit
52+ get_target_property (module_name ${target} Swift_MODULE_NAME)
53+ set (depfile_name "${module_name} .emit-module.d" )
54+ cmake_path(APPEND CMAKE_CURRENT_BINARY_DIR ${depfile_name} OUTPUT_VARIABLE depfile_path)
55+
5156 set (_AllSources $<TARGET_PROPERTY:${target} ,SOURCES >)
5257 set (_SwiftSources $<FILTER :${_AllSources} ,INCLUDE ,\\.swift$>)
5358 # Ideally in this next line we'd use
@@ -73,6 +78,8 @@ function(_swift_generate_cxx_header target header)
7378 -module-name "${ARG_MODULE_NAME} "
7479 -cxx-interoperability-mode=default
7580 -emit-clang-header-path ${header_path}
81+ -emit-dependencies
82+ DEPFILE ${depfile_path}
7683 COMMENT
7784 "Generating '${header_path} '"
7885 COMMAND_EXPAND_LISTS )
You can’t perform that action at this time.
0 commit comments