Skip to content
This repository was archived by the owner on Jul 1, 2023. It is now read-only.

Commit d2e3b0c

Browse files
authored
build: correct the install rules for Darwin (#1175)
We were using the generator expression for the installation of the swift modules on Darwin. However, with swift-numerics, the Numerics module has an implicit link against `_NumericsShims`. This results in the interface include directories having multiple values when computed late. Use `get_target_property` to get the value prior to the additions, allowing us to rename the file into place. Thanks to @dan-zheng for reporting the issue!
1 parent 5538f39 commit d2e3b0c

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

CMakeLists.txt

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -280,16 +280,17 @@ if(ENABLE_SWIFT_NUMERICS)
280280
DESTINATION lib/swift/${swift_os})
281281
endif()
282282

283+
get_target_property(${module}_INTERFACE_INCLUDE_DIRECTORIES ${module}
284+
INTERFACE_INCLUDE_DIRECTORIES)
285+
283286
if(CMAKE_SYSTEM_NAME STREQUAL Darwin)
284-
install(FILES $<TARGET_PROPERTY:${module},INTERFACE_INCLUDE_DIRECTORIES>/${module}.swiftdoc
285-
DESTINATION lib/swift/${swift_os}/${module}.swiftmodule
287+
install(FILES ${${module}_INTERFACE_INCLUDE_DIRECTORIES}/${module}.swiftdoc
288+
DESTINATION lib/swift/${swift_os}/${module}.swiftmodule/
286289
RENAME ${swift_arch}.swiftdoc)
287-
install(FILES $<TARGET_PROPERTY:${module},INTERFACE_INCLUDE_DIRECTORIES>/${module}.swiftmodule
288-
DESTINATION lib/swift/${swift_os}/${module}.swiftmodule
290+
install(FILES ${${module}_INTERFACE_INCLUDE_DIRECTORIES}/${module}.swiftmodule
291+
DESTINATION lib/swift/${swift_os}/${module}.swiftmodule/
289292
RENAME ${swift_arch}.swiftmodule)
290293
else()
291-
get_target_property(${module}_INTERFACE_INCLUDE_DIRECTORIES ${module}
292-
INTERFACE_INCLUDE_DIRECTORIES)
293294
install(FILES
294295
${${module}_INTERFACE_INCLUDE_DIRECTORIES}/${module}.swiftdoc
295296
${${module}_INTERFACE_INCLUDE_DIRECTORIES}/${module}.swiftmodule

0 commit comments

Comments
 (0)