diff --git a/modules/xcode/tests/test_xcode_project.lua b/modules/xcode/tests/test_xcode_project.lua index 27972b67..2d4eff37 100644 --- a/modules/xcode/tests/test_xcode_project.lua +++ b/modules/xcode/tests/test_xcode_project.lua @@ -1738,6 +1738,49 @@ ]] end + function suite.XCBuildConfigurationTarget_OnOSXMinVersion() + _TARGET_OS = "macosx" + systemversion "10.11" + prepare() + xcode.XCBuildConfiguration_Target(tr, tr.products.children[1], tr.configs[1]) + test.capture [[ + FDC4CBFB4635B02D8AD4823B /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CONFIGURATION_BUILD_DIR = bin/Debug; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + GCC_DYNAMIC_NO_PIC = NO; + INSTALL_PATH = /usr/local/bin; + MACOSX_DEPLOYMENT_TARGET = 10.11; + PRODUCT_NAME = MyProject; + }; + name = Debug; + }; + ]] + end + + function suite.XCBuildConfigurationTarget_OnOSXUnSpecificedVersion() + _TARGET_OS = "macosx" + -- systemversion "10.11" + prepare() + xcode.XCBuildConfiguration_Target(tr, tr.products.children[1], tr.configs[1]) + test.capture [[ + FDC4CBFB4635B02D8AD4823B /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CONFIGURATION_BUILD_DIR = bin/Debug; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + GCC_DYNAMIC_NO_PIC = NO; + INSTALL_PATH = /usr/local/bin; + PRODUCT_NAME = MyProject; + }; + name = Debug; + }; + ]] + end + function suite.XCBuildConfigurationTarget_OnInfoPlist() files { "./a/b/c/MyProject-Info.plist" } diff --git a/modules/xcode/xcode_common.lua b/modules/xcode/xcode_common.lua index 9abfe396..0a32f224 100644 --- a/modules/xcode/xcode_common.lua +++ b/modules/xcode/xcode_common.lua @@ -1233,6 +1233,11 @@ if family then settings['TARGETED_DEVICE_FAMILY'] = family end + else + local minOSVersion = project.systemversion(cfg) + if minOSVersion ~= nil then + settings['MACOSX_DEPLOYMENT_TARGET'] = minOSVersion + end end --ms not by default ...add it manually if you need it