Skip to content

Commit

Permalink
[boost-context] support android (#16930)
Browse files Browse the repository at this point in the history
  • Loading branch information
huangqinjin committed Apr 30, 2021
1 parent b7057d1 commit 8badb23
Show file tree
Hide file tree
Showing 10 changed files with 47 additions and 11 deletions.
11 changes: 8 additions & 3 deletions ports/boost-build/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ if(CMAKE_HOST_WIN32 AND VCPKG_CMAKE_SYSTEM_NAME AND NOT VCPKG_CMAKE_SYSTEM_NAME
return()
endif()

set(BOOST_VERSION 1.75.0.beta1)
set(BOOST_VERSION 1.75.0)

vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO boostorg/build
REF boost-${BOOST_VERSION}
SHA512 e5dd73ef41d341e2bce25677389502d22ca7f328e7fdbb91d95aac415f7b490008d75ff0a63f8e4bd9427215f863c161ec9573c29b663b727df4b60e25a3aac2
SHA512 dc5784cdcc908591a8c8814dac32849fb00b5f5b2d48de963d51a0571fd9f5a0419d6bb569f3375bf8fbfae28d680db4ce869604667b717023e76869836534f4
HEAD_REF master
PATCHES
fix_options.patch
Expand All @@ -28,8 +28,13 @@ vcpkg_download_distfile(BOOSTCPP_ARCHIVE
SHA512 8cf929fa4a602342c859a6bbd5f9dda783ac29431d951bcf6cae4cb14377c1b3aed90bacd902b0f7d1807591cf5e1a244cf8fc3c6cc6e0a4056db145b58f51df
)

# https://github.com/boostorg/boost/pull/206
# do not add version suffix for android
file(READ "${BOOSTCPP_ARCHIVE}" _contents)
string(REPLACE "aix &&" "aix android &&" _contents "${_contents}")
file(WRITE "${SOURCE_PATH}/boostcpp.jam" "${_contents}")

file(INSTALL ${ARCHIVE} DESTINATION ${CURRENT_PACKAGES_DIR}/share/boost-build RENAME copyright)
file(INSTALL ${BOOSTCPP_ARCHIVE} DESTINATION ${CURRENT_PACKAGES_DIR}/tools/boost-build RENAME boostcpp.jam)

# This fixes the lib path to use desktop libs instead of uwp -- TODO: improve this with better "host" compilation
string(REPLACE "\\store\\;" "\\;" LIB "$ENV{LIB}")
Expand Down
3 changes: 1 addition & 2 deletions ports/boost-build/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"name": "boost-build",
"version-string": "1.75.0.beta1",
"port-version": 1,
"version-string": "1.75.0",
"description": "Boost.Build",
"homepage": "https://github.com/boostorg/build",
"dependencies": [
Expand Down
15 changes: 15 additions & 0 deletions ports/boost-context/b2-options.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,18 @@ if(@VCPKG_TARGET_IS_OSX@)
binary-format=mach-o
)
endif()

if(@VCPKG_TARGET_IS_ANDROID@)
if(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm" OR VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64")
list(APPEND B2_OPTIONS
abi=aapcs
)
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86" OR VCPKG_TARGET_ARCHITECTURE STREQUAL "x64")
list(APPEND B2_OPTIONS
abi=sysv
)
endif()
list(APPEND B2_OPTIONS
binary-format=elf
)
endif()
2 changes: 1 addition & 1 deletion ports/boost-context/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "boost-context",
"version-string": "1.75.0",
"port-version": 3,
"port-version": 4,
"description": "Boost context module",
"homepage": "https://github.com/boostorg/context",
"supports": "!uwp & !emscripten",
Expand Down
2 changes: 2 additions & 0 deletions ports/boost-modular-build-helper/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ if(APPLE)
list(APPEND B2_OPTIONS target-os=darwin toolset=clang)
elseif(WIN32)
list(APPEND B2_OPTIONS target-os=windows toolset=gcc)
elseif(ANDROID)
list(APPEND B2_OPTIONS target-os=android toolset=gcc)
else()
list(APPEND B2_OPTIONS target-os=linux toolset=gcc)
endif()
Expand Down
2 changes: 1 addition & 1 deletion ports/boost-modular-build-helper/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "boost-modular-build-helper",
"version-string": "1.75.0",
"port-version": 8,
"port-version": 9,
"dependencies": [
"boost-build",
"boost-uninstall"
Expand Down
5 changes: 5 additions & 0 deletions versions/b-/boost-build.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "8e84097fbdf78eb6220bb0bb7c63addefb6301d9",
"version-string": "1.75.0",
"port-version": 0
},
{
"git-tree": "f6c7fe38fdff5e1a5d4ffe9e9fbc7efe0f7e01d3",
"version-string": "1.75.0.beta1",
Expand Down
5 changes: 5 additions & 0 deletions versions/b-/boost-context.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "73ede4d1c06f12b1162f39e0b03935cc429c763a",
"version-string": "1.75.0",
"port-version": 4
},
{
"git-tree": "7545171af99470b6486fdb0bc42a0d9fd93d0f6e",
"version-string": "1.75.0",
Expand Down
5 changes: 5 additions & 0 deletions versions/b-/boost-modular-build-helper.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "c475b268ac42e886acfdc783944e1e3a988b0ac8",
"version-string": "1.75.0",
"port-version": 9
},
{
"git-tree": "dd4c0cc6612065f35f4feba1cd5616ed4e249f1e",
"version-string": "1.75.0",
Expand Down
8 changes: 4 additions & 4 deletions versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -469,8 +469,8 @@
"port-version": 0
},
"boost-build": {
"baseline": "1.75.0.beta1",
"port-version": 1
"baseline": "1.75.0",
"port-version": 0
},
"boost-callable-traits": {
"baseline": "1.75.0",
Expand Down Expand Up @@ -510,7 +510,7 @@
},
"boost-context": {
"baseline": "1.75.0",
"port-version": 3
"port-version": 4
},
"boost-contract": {
"baseline": "1.75.0",
Expand Down Expand Up @@ -714,7 +714,7 @@
},
"boost-modular-build-helper": {
"baseline": "1.75.0",
"port-version": 8
"port-version": 9
},
"boost-move": {
"baseline": "1.75.0",
Expand Down

0 comments on commit 8badb23

Please sign in to comment.