Skip to content

Commit b8bb65f

Browse files
committed
[android] Fix test setup for Android to avoid using -sdk.
The recently introduced changes to make the -sdk also the resource directory broke the tests in Android, since -sdk was being used because it is passed as --sysroot to child invocations, which was convinient. This commit removes those usages in the test suite, and switches to use --sysroot for the compiler and the linker. Even if in Android only the linker bit is necessary (since the NDK headers are somewhere different, and are passed as -I parameters to Swift).
1 parent f82572a commit b8bb65f

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

test/lit.cfg

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1115,7 +1115,8 @@ elif run_os == 'linux-androideabi' or run_os == 'linux-android':
11151115
config.target_build_swift = ' '.join([
11161116
config.swiftc,
11171117
'-target', config.variant_triple,
1118-
'-sdk', config.variant_sdk,
1118+
'-Xcc', '--sysroot={}'.format(config.variant_sdk),
1119+
'-Xclang-linker', '--sysroot={}'.format(config.variant_sdk),
11191120
'-tools-directory', tools_directory,
11201121
android_include_paths_opt, android_link_paths_opt,
11211122
'-use-ld=%s' % config.android_linker_name,
@@ -1131,7 +1132,6 @@ elif run_os == 'linux-androideabi' or run_os == 'linux-android':
11311132
config.swift,
11321133
'-frontend',
11331134
'-target', config.variant_triple,
1134-
'-sdk', config.variant_sdk,
11351135
android_include_paths_opt, android_link_paths_opt,
11361136
resource_dir_opt, mcp_opt, config.swift_test_options,
11371137
config.swift_frontend_test_options])
@@ -1153,7 +1153,8 @@ elif run_os == 'linux-androideabi' or run_os == 'linux-android':
11531153
config.target_swiftc_driver = ' '.join([
11541154
config.swiftc,
11551155
'-target', config.variant_triple,
1156-
'-sdk', config.variant_sdk,
1156+
'-Xcc', '--sysroot={}'.format(config.variant_sdk),
1157+
'-Xclang-linker', '--sysroot={}'.format(config.variant_sdk),
11571158
'-tools-directory', tools_directory,
11581159
android_link_paths_opt, resource_dir_opt, mcp_opt,
11591160
'-use-ld=%s' % config.android_linker_name])

0 commit comments

Comments
 (0)