Skip to content

Commit a15b58d

Browse files
authored
Merge pull request #278 from drodriguez/cmake-update-swift-support
[cmake] Update SwiftSupport.cmake to allow passing link flags
2 parents b5ecf30 + 0f028db commit a15b58d

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@ add_swift_library(XCTest
8888
Sources/XCTest/Public/Asynchronous/XCTWaiter.swift
8989
Sources/XCTest/Public/Asynchronous/XCTestCase+Asynchronous.swift
9090
Sources/XCTest/Public/Asynchronous/XCTestExpectation.swift
91+
TARGET
92+
${CMAKE_C_COMPILER_TARGET}
9193
SWIFT_FLAGS
9294
$<$<NOT:$<CONFIG:Debug>>:-O>
9395

cmake/modules/SwiftSupport.cmake

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ function(add_swift_target target)
99
cmake_parse_arguments(AST "${options}" "${single_value_options}" "${multiple_value_options}" ${ARGN})
1010

1111
set(compile_flags ${CMAKE_SWIFT_FLAGS})
12-
set(link_flags)
12+
set(link_flags ${CMAKE_SWIFT_LINK_FLAGS})
1313

1414
if(AST_TARGET)
1515
list(APPEND compile_flags -target;${AST_TARGET})
@@ -219,7 +219,7 @@ function(add_swift_executable executable)
219219
add_swift_target(${executable} ${ARGN})
220220
endfunction()
221221

222-
# Returns the current achitecture name in a variable
222+
# Returns the current architecture name in a variable
223223
#
224224
# Usage:
225225
# get_swift_host_arch(result_var_name)
@@ -241,6 +241,8 @@ function(get_swift_host_arch result_var_name)
241241
set("${result_var_name}" "armv6" PARENT_SCOPE)
242242
elseif("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "armv7l")
243243
set("${result_var_name}" "armv7" PARENT_SCOPE)
244+
elseif("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "armv7-a")
245+
set("${result_var_name}" "armv7" PARENT_SCOPE)
244246
elseif("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "AMD64")
245247
set("${result_var_name}" "x86_64" PARENT_SCOPE)
246248
elseif("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "IA64")

0 commit comments

Comments
 (0)