Skip to content

Commit 1fff12f

Browse files
authored
Merge pull request swiftlang#29511 from compnerd/cohabitation
build: move `compute_library_subdir` to where it is used
2 parents 566d574 + 049e384 commit 1fff12f

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

cmake/modules/AddSwift.cmake

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,6 @@ function(add_dependencies_multiple_targets)
2828
endif()
2929
endfunction()
3030

31-
# Compute the library subdirectory to use for the given sdk and
32-
# architecture, placing the result in 'result_var_name'.
33-
function(compute_library_subdir result_var_name sdk arch)
34-
if(sdk IN_LIST SWIFT_APPLE_PLATFORMS OR sdk STREQUAL "MACCATALYST")
35-
set("${result_var_name}" "${SWIFT_SDK_${sdk}_LIB_SUBDIR}" PARENT_SCOPE)
36-
else()
37-
set("${result_var_name}" "${SWIFT_SDK_${sdk}_LIB_SUBDIR}/${arch}" PARENT_SCOPE)
38-
endif()
39-
endfunction()
40-
4131
function(_compute_lto_flag option out_var)
4232
string(TOLOWER "${option}" lowercase_option)
4333
if (lowercase_option STREQUAL "full")

cmake/modules/SwiftSource.cmake

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
include(macCatalystUtils)
22
include(SwiftUtils)
33

4+
# Compute the library subdirectory to use for the given sdk and
5+
# architecture, placing the result in 'result_var_name'.
6+
function(compute_library_subdir result_var_name sdk arch)
7+
if(sdk IN_LIST SWIFT_APPLE_PLATFORMS OR sdk STREQUAL "MACCATALYST")
8+
set("${result_var_name}" "${SWIFT_SDK_${sdk}_LIB_SUBDIR}" PARENT_SCOPE)
9+
else()
10+
set("${result_var_name}" "${SWIFT_SDK_${sdk}_LIB_SUBDIR}/${arch}" PARENT_SCOPE)
11+
endif()
12+
endfunction()
13+
414
# Process the sources within the given variable, pulling out any Swift
515
# sources to be compiled with 'swift' directly. This updates
616
# ${sourcesvar} in place with the resulting list and ${externalvar} with the

0 commit comments

Comments
 (0)