Skip to content

Adjust boost related files to enable cross compiling#6217

Closed
sgr-ms wants to merge 4 commits intomicrosoft:masterfrom
sgr-ms:dev/sgr-ms/multi-platform-boost
Closed

Adjust boost related files to enable cross compiling#6217
sgr-ms wants to merge 4 commits intomicrosoft:masterfrom
sgr-ms:dev/sgr-ms/multi-platform-boost

Conversation

@sgr-ms
Copy link

@sgr-ms sgr-ms commented Apr 26, 2019

Specifically boost-uuid and its dependencies. This enabled cross compilation for iOS and Android

if(NOT VCPKG_TARGET_ARCHITECTURE STREQUAL "x64" AND NOT VCPKG_TARGET_ARCHITECTURE STREQUAL "x86")
return()
elseif(CMAKE_HOST_WIN32 AND VCPKG_CMAKE_SYSTEM_NAME AND NOT VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
elseif(CMAKE_HOST_WIN32 AND VCPKG_CMAKE_SYSTEM_NAME AND NOT VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Windows")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

empty VCPKG_CMAKE_SYSTEM_NAME means Windows triplet and WindowsStore means uwp triplet. I don't see any triplet that sets it to "Windows".

Copy link
Author

@sgr-ms sgr-ms Apr 29, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess I was basing this off of CMAKE_SYSTEM_NAME which should default to CMAKE_HOST_SYSTEM_NAME. Should I just leave it as
elseif(CMAKE_HOST_WIN32) ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that would give you the behavior you are looking for.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is noop the boost-build port in these situations?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because AFAIK we don't build the build system for boost for the target platform but only for the host, so if we're building on Windows even if we cross compile for store we still use the x86 boost build version (I hope I'm remember @ras0219-msft 's explanation correctly :) ).

And I think that removing this check won't work, because what I want to achieve is built the tools only if I'm trying to build them for the host platform (so I'm testing whether it's not Windows to detect cross compilation on Windows for e.g. store or Android x86), what do you think?

@PhoebeHui
Copy link
Contributor

@sgr-ms, thanks for the PR, it seems that supports cross compilling currently, we're closing this for now, feel free to reopen this PR if I'm wrong here.

@PhoebeHui PhoebeHui closed this May 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants