-
Notifications
You must be signed in to change notification settings - Fork 471
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
Conversation
dispatch/dispatch.h
Outdated
@@ -30,6 +30,8 @@ | |||
#include <os/linux_base.h> | |||
#endif | |||
|
|||
#include <string.h> |
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.
This should probably be wrapped with an #if ANDROID
cmake/modules/SwiftSupport.cmake
Outdated
@@ -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 comment
The 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 comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I think that we should always add the sysroot here.
@@ -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}) |
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
@compnerd you did most of the cmake porting, can you review the change please? |
dispatch/dispatch.h
Outdated
@@ -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 comment
The reason will be displayed to describe this comment to others. Learn more.
I think that this can be done unconditionally.
cmake/modules/SwiftSupport.cmake
Outdated
@@ -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 comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I think that we should always add the sysroot here.
Can you please squash the changes into a single commit? |
dispatch/dispatch.h
Outdated
@@ -30,6 +30,8 @@ | |||
#include <os/linux_base.h> | |||
#endif | |||
|
|||
|
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.
please remove the empty line
@@ -93,7 +95,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 comment
The reason will be displayed to describe this comment to others. Learn more.
do we want the same for armv6l above?
@@ -20,4 +20,8 @@ | |||
#define _Static_assert(...) | |||
#endif | |||
|
|||
#ifndef TRASHIT |
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.
I'm fairly sure this has been moved to internal.h
already in a previous PR, please remove.
Also please squash in a single commit. |
Seek to avoid spurious test timeouts in Swift CI by raising limit for individual test execution from 30 seconds to 120 seconds.
This is the first commit of several to bring libdispatch support up to date on FreeBSD
this branch seems completely broken :/ |
@MadCoder can you elaborate? We are successfully working with this fork, since we need the android support. Would be nice to have this merged. |
I'm going to close this PR for now. It no longer cleanly applies. I believe that libdispatch builds for android currently, but, if it does not, that is certainly that should be addressed. |
As mentioned in #312, this fixes the build for Android and works on both Mac and Linux with the following CMake invocation: