Skip to content

Commit 7fa1c3c

Browse files
compnerdjpsim
authored andcommitted
build: use a single top-level Swift module directory
Rather than have a swift module directory that you need to find for each library, use a single global swift module directory similar to the runtime output directory. This will be useful for a follow up change to enable tests.
1 parent d9173c6 commit 7fa1c3c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ else()
2929
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
3030
endif()
3131
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
32+
set(CMAKE_Swift_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/swift)
3233

3334
include(SwiftSupport)
3435

Sources/Yams/CMakeLists.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,8 @@ target_link_libraries(Yams PRIVATE
2222
CYaml
2323
${CORELIBS_FOUNDATION})
2424
set_target_properties(Yams PROPERTIES
25-
Swift_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/swift
2625
INTERFACE_COMPILE_OPTIONS "SHELL:-Xcc -I$<TARGET_PROPERTY:CYaml,INCLUDE_DIRECTORIES>"
27-
INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_CURRENT_BINARY_DIR}/swift)
26+
INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_Swift_MODULE_DIRECTORY})
2827

2928
set_property(GLOBAL APPEND PROPERTY YAMS_EXPORTS Yams)
3029
get_swift_host_arch(swift_arch)

0 commit comments

Comments
 (0)