Skip to content

Commit c52047c

Browse files
committed
[android] fix the android build
Macros can't yet be built as there's no host build support yet
1 parent aec5170 commit c52047c

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

Sources/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414

1515
add_subdirectory(_FoundationCShims)
1616

17-
# Disable the macro build on Windows until we can correctly build it for the host architecture
18-
if(NOT CMAKE_SYSTEM_NAME STREQUAL Windows)
17+
# Disable the macro build on Windows and Android until we can correctly build it for the host architecture
18+
if(NOT (CMAKE_SYSTEM_NAME STREQUAL "Windows" OR CMAKE_SYSTEM_NAME STREQUAL "Android"))
1919
add_subdirectory(FoundationMacros)
2020
endif()
2121

Sources/FoundationEssentials/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ add_subdirectory(String)
4848
add_subdirectory(TimeZone)
4949
add_subdirectory(URL)
5050

51-
if(NOT CMAKE_SYSTEM_NAME STREQUAL Windows)
51+
if(NOT (CMAKE_SYSTEM_NAME STREQUAL "Windows" OR CMAKE_SYSTEM_NAME STREQUAL "Android"))
5252
# Depend on FoundationMacros
5353
add_dependencies(FoundationEssentials FoundationMacros)
5454
target_compile_options(FoundationEssentials PRIVATE -plugin-path ${CMAKE_BINARY_DIR}/lib)

Sources/FoundationEssentials/FileManager/FileOperations+Enumeration.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,8 @@ struct _FTSSequence: Sequence {
166166
return
167167
}
168168

169-
state = [UnsafeMutablePointer(mutating: path), nil].withUnsafeBufferPointer { dirList in
170-
guard let stream = fts_open(dirList.baseAddress!, opts, nil) else {
169+
state = [Optional(UnsafeMutablePointer(mutating: path)), nil].withUnsafeBufferPointer { dirList in
170+
guard let stream = fts_open(unsafeBitCast(dirList.baseAddress!, to: UnsafePointer<UnsafeMutablePointer<CChar>>.self), opts, nil) else {
171171
return .error(errno, String(cString: path))
172172
}
173173
return .stream(stream)

0 commit comments

Comments
 (0)