-
Notifications
You must be signed in to change notification settings - Fork 6.6k
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
[boost-modular-build-helper] Bugfix/boost arm64 ios #18124
Closed
Closed
Changes from 5 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
ef00875
bugfix/boost_arm64_ios
b9a8813
Merge branch 'master' of https://github.com/microsoft/vcpkg
94f9511
using iPhoneOS.sdk
21c8181
adding iOS condition
2186fa2
Restrict change to system iOS and added OSX fix
StefAviator fd750d5
update port version to 10
StefAviator 778c474
update port version part 2
StefAviator File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,9 +8,37 @@ if "@VCPKG_PLATFORM_TOOLSET@" != "external" | |
@TOOLSET_OPTIONS@ | ||
; | ||
} | ||
else if "@VCPKG_TARGET_ARCHITECTURE@" = "arm64" && "@VCPKG_CMAKE_SYSTEM_NAME@" = "iOS" | ||
{ | ||
using gcc : 12.0.0 : @CMAKE_CXX_COMPILER@ | ||
: | ||
<ranlib>@CMAKE_RANLIB@ | ||
<archiver>@CMAKE_AR@ | ||
@CXXFLAGS@ | ||
@CFLAGS@ | ||
@LDFLAGS@ | ||
# MINGW here causes b2 to not run cygpath | ||
<flavor>mingw | ||
<compileflags>"-std=c++14 -stdlib=libc++ -DNDEBUG -arch arm64 -fembed-bitcode -Wno-unused-local-typedef -Wno-nullability-completeness -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk" | ||
; | ||
} | ||
else if "@VCPKG_TARGET_ARCHITECTURE@" = "arm64" && "@VCPKG_CMAKE_SYSTEM_NAME@" = "Darwin" | ||
{ | ||
using gcc : 12.0.0 : @CMAKE_CXX_COMPILER@ | ||
: | ||
<ranlib>@CMAKE_RANLIB@ | ||
<archiver>@CMAKE_AR@ | ||
@CXXFLAGS@ | ||
@CFLAGS@ | ||
@LDFLAGS@ | ||
# MINGW here causes b2 to not run cygpath | ||
<flavor>mingw | ||
<compileflags>"-std=c++14 -stdlib=libc++ -DNDEBUG -arch arm64 -fembed-bitcode -Wno-unused-local-typedef -Wno-nullability-completeness -mmacosx-version-min=10.12 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk" | ||
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. Here we are using the default MacOS sdk on the system. "Darwin" above is used in the triplet for unix / osx / MacOS. |
||
; | ||
} | ||
else | ||
{ | ||
using gcc : 5.4.1 : @CMAKE_CXX_COMPILER@ | ||
using gcc : 12.0.0 : @CMAKE_CXX_COMPILER@ | ||
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. Updating to the latest gcc. |
||
: | ||
<ranlib>@CMAKE_RANLIB@ | ||
<archiver>@CMAKE_AR@ | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 compilerflag is needed to compile arm64 for iOS
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.
There's a way to specify the iOS target via the
CMakeLists.txt
file, which could remove the need to change theuser-config.jam
. Specifically the line that specifies thetarget-os
option:For iOS, that would be
target-os=iphone
docsIt would also be nice to make this work for both arm64 iOS and macOS builds, i.e. the
arm64-ios
andarm64-osx
triplets:and
Boosts's b2 doesn't natively support
arm64
, so the extra-arch arm64
can be added to theCMakeLists.txt
config like so: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 have tried adding these compilerflags to CMakeLists.txt but it keeps outputting x86-64 library files so unfortunately it does not work. I tried this change using both unix_build and the second builder. If you know how to get this to work to cross-compile on an Apple PC/laptop with Intel chip to arm64 by adjusting the CMakeLists file, please share.