Skip to content
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

compatible with CMAKE_${lang}_OSX_DEPLOYMENT_TARGET_FLAG #38735

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Arlen-LT
Copy link

Since CMake 3.28.4 which support xcode 15.2 and xros deployment version, the content of Modules/Platform/Apple-Clang.cmake has changed as per commit 40be88a9:

  elseif(_CMAKE_OSX_SYSROOT_PATH MATCHES "/XROS")
    set(CMAKE_${lang}_OSX_DEPLOYMENT_TARGET_FLAG "--target=<ARCH>-apple-xros<VERSION_MIN>")
  elseif(_CMAKE_OSX_SYSROOT_PATH MATCHES "/XRSimulator")
    set(CMAKE_${lang}_OSX_DEPLOYMENT_TARGET_FLAG "--target=<ARCH>-apple-xros<VERSION_MIN>-simulator")

This approach is unlike the traditional -m{platform}-version-min= and causes issues when set(VCPKG_OSX_SYSROOT xros) and set(VCPKG_OSX_DEPLOYMENT_TARGET *.*). By debugging the buildtrees/$port/config.log of any port, there is a flag pass to compiler like --target=<ARCH>-apple-xros<VERSION_MIN>*.*, as there is no compatible way similar to other Apple platforms (e.g., a flag like -mxros-version-min=) until now(05/15/2024).
So on my opinion, although there is currently no official or community triplet for building xros, maintaining compatibility with CMake is preferable. This patch will not affect those who are not using xros, it is only for future compatibility.

@MonicaLiu0311 MonicaLiu0311 added the category:tool-update The issue is with build tool or build script, which requires update or should be executed correctly label May 15, 2024
@LilyWangLL LilyWangLL added the info:reviewed Pull Request changes follow basic guidelines label May 16, 2024
list(GET VCPKG_LANGUAGES 0 lang)
string(APPEND ${flag_var} " ${CMAKE_${lang}_OSX_DEPLOYMENT_TARGET_FLAG}${CMAKE_OSX_DEPLOYMENT_TARGET}")
list(GET CMAKE_OSX_ARCHITECTURES 0 arch)
Copy link
Contributor

Choose a reason for hiding this comment

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

Given CMAKE_OSX_ARCHITECTURES could specify multiple architectures, should this be a for loop?

Copy link
Contributor

Choose a reason for hiding this comment

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

Pinging @Arlen-LT for response.

@LilyWangLL LilyWangLL removed the info:reviewed Pull Request changes follow basic guidelines label May 17, 2024
@LilyWangLL LilyWangLL marked this pull request as draft May 23, 2024 06:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:tool-update The issue is with build tool or build script, which requires update or should be executed correctly
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants