-
Notifications
You must be signed in to change notification settings - Fork 472
Fix build for android #332
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
Changes from 2 commits
5a29a0a
dc3a161
49ef9c2
950feac
8ab4c98
6ab6b91
8165642
8c391d1
28eff8f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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}) | ||
|
@@ -38,6 +38,10 @@ function(add_swift_library library) | |
endforeach() | ||
endif() | ||
|
||
if(CMAKE_SYSTEM_NAME STREQUAL Android) | ||
list(APPEND flags -sdk;${CMAKE_SYSROOT}) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It probably makes sense to always add the sysroot? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, I think that we should always add the sysroot here. |
||
endif() | ||
|
||
# FIXME: We shouldn't /have/ to build things in a single process. | ||
# <rdar://problem/15972329> | ||
list(APPEND flags -force-single-frontend-invocation) | ||
|
@@ -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") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. do we want the same for armv6l above? |
||
set("${result_var_name}" "armv7" PARENT_SCOPE) | ||
elseif("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "AMD64") | ||
set("${result_var_name}" "x86_64" PARENT_SCOPE) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,6 +30,10 @@ | |
#include <os/linux_base.h> | ||
#endif | ||
|
||
#ifdef __ANDROID__ | ||
#include <string.h> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should probably be wrapped with an #if ANDROID There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think that this can be done unconditionally. |
||
#endif | ||
|
||
#include <sys/types.h> | ||
#include <stddef.h> | ||
#include <stdint.h> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -217,4 +217,3 @@ if(ENABLE_SWIFT) | |
DESTINATION | ||
"${INSTALL_TARGET_DIR}/${CMAKE_SYSTEM_PROCESSOR}") | ||
endif() | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,4 +20,8 @@ | |
#define _Static_assert(...) | ||
#endif | ||
|
||
#ifndef TRASHIT | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm fairly sure this has been moved to |
||
#define TRASHIT(x) do { (x) = (void *)-1; } while (0) | ||
#endif | ||
|
||
#endif /* __DISPATCH__ANDROID__STUBS__INTERNAL */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
apparently CMake variable names are case sensitive. This is a typo introduced in an earlier PR