Skip to content

Commit 1551e01

Browse files
committed
Adding -nostdinc++ to Android build of Swift.
On Android, we explicitly setup the include paths for the C++ headers. As a result, we do not want to pick up any system headers that the toolchain may have visible to it. If this flag is not added then clang will look in the wrong places to get the headers for things like stddef etc.
1 parent 81a69f3 commit 1551e01

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

cmake/modules/AddSwift.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,7 @@ function(_add_variant_c_compile_flags)
324324
endif()
325325

326326
if("${CFLAGS_SDK}" STREQUAL "ANDROID")
327+
list(APPEND result -nostdinc++)
327328
swift_android_libcxx_include_paths(CFLAGS_CXX_INCLUDES)
328329
swift_android_include_for_arch("${CFLAGS_ARCH}" "${CFLAGS_ARCH}_INCLUDE")
329330
foreach(path IN LISTS CFLAGS_CXX_INCLUDES ${CFLAGS_ARCH}_INCLUDE)

0 commit comments

Comments
 (0)