Skip to content

Commit 280b532

Browse files
committed
Review comments.
1 parent 6277c7e commit 280b532

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

3_bidirectional_cxx_interop/cmake/modules/AddSwift.cmake

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,9 @@ 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)
51+
cmake_path(APPEND CMAKE_CURRENT_BINARY_DIR "${ARG_MODULE_NAME}.emit-module.d" OUTPUT_VARIABLE depfile_path)
5552

56-
set(_AllSources $<TARGET_PROPERTY:${target},SOURCES>)
53+
set(_AllSources $<PATH:ABSOLUTE_PATH,$<TARGET_PROPERTY:${target},SOURCES>,${CMAKE_CURRENT_SOURCE_DIR}>)
5754
set(_SwiftSources $<FILTER:${_AllSources},INCLUDE,\\.swift$>)
5855
add_custom_command(OUTPUT ${header_path}
5956
DEPENDS ${_SwiftSources}
@@ -67,7 +64,8 @@ function(_swift_generate_cxx_header target header)
6764
-cxx-interoperability-mode=default
6865
-emit-clang-header-path ${header_path}
6966
-emit-dependencies
70-
DEPFILE ${depfile_path}
67+
DEPFILE "${depfile_path}"
68+
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
7169
COMMENT
7270
"Generating '${header_path}'"
7371
COMMAND_EXPAND_LISTS)

0 commit comments

Comments
 (0)