Skip to content

Commit c7f9a66

Browse files
committed
android: add a SwiftAndroidNDK.h header for the Android module
1 parent 0bf9207 commit c7f9a66

File tree

3 files changed

+96
-2
lines changed

3 files changed

+96
-2
lines changed

lib/ClangImporter/ClangIncludePaths.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,8 @@ ClangInvocationFileMapping swift::getClangInvocationFileMapping(
554554
// Android uses the android-specific module map that overlays the NDK.
555555
// FIXME: Drop Glibc mapping for android as well.
556556
result.redirectedFiles.append(
557-
getLibcFileMapping(ctx, "android.modulemap", std::nullopt, vfs));
557+
getLibcFileMapping(ctx, "android.modulemap",
558+
StringRef("SwiftAndroidNDK.h"), vfs));
558559
}
559560
// Both libc module maps have the C standard library headers all together in a
560561
// SwiftLibc module. That leads to module cycles with the clang _Builtin_

stdlib/public/Platform/CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,10 @@ foreach(sdk ${SWIFT_SDKS})
292292
"android.modulemap"
293293
DESTINATION "lib/swift/${arch_subdir}"
294294
COMPONENT sdk-overlay)
295+
swift_install_in_component(FILES
296+
"SwiftAndroidNDK.h"
297+
DESTINATION "lib/swift/${arch_subdir}"
298+
COMPONENT sdk-overlay)
295299
endif()
296300

297301
if(SWIFT_BUILD_STATIC_STDLIB)
@@ -353,4 +357,4 @@ if(WINDOWS IN_LIST SWIFT_SDKS)
353357
winsdk.modulemap
354358
DESTINATION "share"
355359
COMPONENT sdk-overlay)
356-
endif()
360+
endif()
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
#ifndef SWIFT_ANDROID_NDK_MODULE
2+
#define SWIFT_ANDROID_NDK_MODULE
3+
4+
#include "complex.h"
5+
#include "ctype.h"
6+
#include "errno.h"
7+
#include "fenv.h"
8+
#include "inttypes.h"
9+
#include "limits.h"
10+
#include "locale.h"
11+
#include "malloc.h"
12+
#include "math.h"
13+
#include "pty.h"
14+
#include "setjmp.h"
15+
#include "signal.h"
16+
#include "stdatomic.h"
17+
#include "stdint.h"
18+
#include "stdio.h"
19+
#include "stdio_ext.h"
20+
#include "stdlib.h"
21+
#include "string.h"
22+
#include "time.h"
23+
#include "utmp.h"
24+
25+
#include "alloca.h"
26+
#include "ar.h"
27+
#include "cpio.h"
28+
#include "dirent.h"
29+
#include "dlfcn.h"
30+
#include "err.h"
31+
#include "errno.h"
32+
#include "execinfo.h"
33+
#include "fcntl.h"
34+
#include "fenv.h"
35+
#include "fnmatch.h"
36+
#include "fts.h"
37+
#include "ftw.h"
38+
#include "getopt.h"
39+
#include "glob.h"
40+
#include "grp.h"
41+
#include "iconv.h"
42+
#include "ifaddrs.h"
43+
#include "jni.h"
44+
#include "langinfo.h"
45+
#include "libgen.h"
46+
#include "link.h"
47+
#include "mntent.h"
48+
#include "netdb.h"
49+
#include "nl_types.h"
50+
#include "paths.h"
51+
#include "poll.h"
52+
#include "pthread.h"
53+
#include "pwd.h"
54+
#include "regex.h"
55+
#include "resolv.h"
56+
#include "sched.h"
57+
#include "search.h"
58+
#include "semaphore.h"
59+
#include "spawn.h"
60+
#include "strings.h"
61+
#include "syscall.h"
62+
#include "sysexits.h"
63+
#include "syslog.h"
64+
#include "tar.h"
65+
#include "termio.h"
66+
#include "termios.h"
67+
#include "threads.h"
68+
#include "uchar.h"
69+
#include "uconfig_local.h"
70+
#include "ucontext.h"
71+
#include "unistd.h"
72+
#include "utime.h"
73+
#include "utmp.h"
74+
#include "utmpx.h"
75+
#include "wait.h"
76+
#include "wchar.h"
77+
#include "xlocale.h"
78+
79+
#include "android/api-level.h"
80+
#include "android/asset_manager_jni.h"
81+
#include "android/asset_manager.h"
82+
#include "android/ndk-version.h"
83+
#include "android/log.h"
84+
#include "android/trace.h"
85+
#include "android/versioning.h"
86+
87+
#include "zlib.h"
88+
89+
#endif // SWIFT_ANDROID_NDK_MODULE

0 commit comments

Comments
 (0)