Skip to content

Ephemer's PR rebased #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions cmake/modules/DispatchCompilerWarnings.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ else()
add_compile_options(-Wno-conversion)
add_compile_options(-Wno-int-conversion)
add_compile_options(-Wno-shorten-64-to-32)
add_compile_options(-Wno-unknown-attributes)
endif()
add_compile_options(-Wno-error=assign-enum)
endmacro()
Expand Down
8 changes: 6 additions & 2 deletions cmake/modules/SwiftSupport.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function(add_swift_library library)
list(APPEND flags -emit-library)

if(ASL_TARGET)
list(APPEND FLAGS -target;${ASL_TARGET})
list(APPEND flags -target;${ASL_TARGET})
endif()
if(ASL_MODULE_NAME)
list(APPEND flags -module-name;${ASL_MODULE_NAME})
Expand All @@ -38,6 +38,10 @@ function(add_swift_library library)
endforeach()
endif()

if(CMAKE_SYSTEM_NAME STREQUAL Android)
list(APPEND flags -sdk;${CMAKE_SYSROOT})
endif()

# FIXME: We shouldn't /have/ to build things in a single process.
# <rdar://problem/15972329>
list(APPEND flags -force-single-frontend-invocation)
Expand Down Expand Up @@ -93,7 +97,7 @@ function(get_swift_host_arch result_var_name)
set("${result_var_name}" "s390x" PARENT_SCOPE)
elseif("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "armv6l")
set("${result_var_name}" "armv6" PARENT_SCOPE)
elseif("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "armv7l")
elseif("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "^armv7")
set("${result_var_name}" "armv7" PARENT_SCOPE)
elseif("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "AMD64")
set("${result_var_name}" "x86_64" PARENT_SCOPE)
Expand Down
4 changes: 4 additions & 0 deletions dispatch/dispatch.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@
#include <os/generic_unix_base.h>
#endif

#ifdef __ANDROID__
#include <string.h>
#endif

#include <sys/types.h>
#include <stddef.h>
#include <stdint.h>
Expand Down
1 change: 0 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -232,4 +232,3 @@ if(ENABLE_SWIFT)
DESTINATION
"${INSTALL_TARGET_DIR}/${CMAKE_SYSTEM_PROCESSOR}")
endif()

4 changes: 4 additions & 0 deletions src/shims/android_stubs.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,8 @@
#define _Static_assert(...)
#endif

#ifndef TRASHIT
#define TRASHIT(x) do { (x) = (void *)-1; } while (0)
#endif

#endif /* __DISPATCH__ANDROID__STUBS__INTERNAL */