leetal / ios-cmake

A CMake toolchain file for iOS/iPadOS, visionOS, macOS, watchOS & tvOS C/C++/Obj-C++ development
BSD 3-Clause "New" or "Revised" License
1.89k stars 448 forks source link

[bug] CMAKE_OSX_DEPLOYMENT_TARGET not CACHE #191

Closed st751228051 closed 10 months ago

st751228051 commented 10 months ago

Describe the bug ios-cmake-4.4.1, build with "-DPLATFORM=MAC -DARCHS=x86_64", top display 10.13, but actualy -target x86_64-apple-macos13.3.

To Reproduce Steps to reproduce the behavior:

  1. ios-cmake-4.4.1
  2. build with "-DPLATFORM=MAC -DARCHS=x86_64"
  3. top display "-- Autoconf target triple: x86_64-apple-macosx10.13 -- Using minimum deployment version: 10.13 (SDK version: 13.3)", but bottom actualy "-target x86_64-apple-macos13.3".

Expected behavior -target x86_64-apple-macos10.13

Environment

Clue: https://cmake.org/cmake/help/latest/variable/CMAKE_OSX_DEPLOYMENT_TARGET.html#variable:CMAKE_OSX_DEPLOYMENT_TARGET This variable should be set as a CACHE entry (or else CMake may remove it while initializing a cache entry of the same name) unless policy CMP0126 is set to NEW.

I change ios.toolchain.cmake Line:829 "set(CMAKE_OSX_DEPLOYMENT_TARGET ${DEPLOYMENT_TARGET})" to "set(CMAKE_OSX_DEPLOYMENT_TARGET ${DEPLOYMENT_TARGET} CACHE STRING "Minimum OS X deployment version")", then it became ok!

leetal commented 10 months ago

I have now begun adding a test-patch to see if i break anything by caching some variables. Please see #192 if you want to test locally as well :)

leetal commented 10 months ago

Fixed in #192