diff --git a/gyp/XCodeDetect.py b/gyp/XCodeDetect.py index cc7b8fac..10df40d4 100644 --- a/gyp/XCodeDetect.py +++ b/gyp/XCodeDetect.py @@ -58,8 +58,8 @@ def HasIPhoneSDK(): if 'HasIPhoneSDK' not in XCodeDetect._cache: try: - out = run('xcrun', '--sdk', 'iphoneos', '--show-sdk-path') + run('xcrun', '--sdk', 'iphoneos', '--show-sdk-path') + XCodeDetect._cache['HasIPhoneSDK'] = True except subprocess.CalledProcessError: - out = 1 - XCodeDetect._cache['HasIPhoneSDK'] = out == 0 + XCodeDetect._cache['HasIPhoneSDK'] = False return XCodeDetect._cache['HasIPhoneSDK'] diff --git a/gyp/xcode_emulation.py b/gyp/xcode_emulation.py index 9864393d..327d37db 100644 --- a/gyp/xcode_emulation.py +++ b/gyp/xcode_emulation.py @@ -1779,6 +1779,7 @@ def _AddIOSDeviceConfigurations(targets): configs = target_dict['configurations'] for config_name, simulator_config_dict in dict(configs).items(): + simulator_config_dict = copy.deepcopy(simulator_config_dict) iphoneos_config_dict = copy.deepcopy(simulator_config_dict) configs[config_name + '-iphoneos'] = iphoneos_config_dict configs[config_name + '-iphonesimulator'] = simulator_config_dict diff --git a/test/ios/app-bundle/test.gyp b/test/ios/app-bundle/test.gyp index 1b2bb0cc..396d73b1 100644 --- a/test/ios/app-bundle/test.gyp +++ b/test/ios/app-bundle/test.gyp @@ -67,7 +67,7 @@ 'INFOPLIST_FILE': 'TestApp/TestApp-Info.plist', 'INFOPLIST_OUTPUT_FORMAT':'xml', 'SDKROOT': 'iphonesimulator', # -isysroot - 'IPHONEOS_DEPLOYMENT_TARGET': '5.0', + 'IPHONEOS_DEPLOYMENT_TARGET': '7.0', 'CONFIGURATION_BUILD_DIR':'build/Default', }, }, diff --git a/test/ios/deployment-target/deployment-target.gyp b/test/ios/deployment-target/deployment-target.gyp index bdc1439b..c652b7d1 100644 --- a/test/ios/deployment-target/deployment-target.gyp +++ b/test/ios/deployment-target/deployment-target.gyp @@ -2,33 +2,159 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. { - 'make_global_settings': [ - ['CC', '/usr/bin/clang'], - ['CXX', '/usr/bin/clang++'], - ], + 'xcode_settings': { + 'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0', + 'CLANG_CXX_LANGUAGE_STANDARD': 'c++14', + 'CLANG_CXX_LIBRARY': 'libc++', + 'ALWAYS_SEARCH_USER_PATHS': 'NO', + 'GCC_CW_ASM_SYNTAX': 'NO', # No -fasm-blocks + 'GCC_DYNAMIC_NO_PIC': 'NO', # No -mdynamic-no-pic + # (Equivalent to -fPIC) + 'GCC_ENABLE_CPP_EXCEPTIONS': 'NO', # -fno-exceptions + 'GCC_ENABLE_CPP_RTTI': 'NO', # -fno-rtti + 'GCC_ENABLE_PASCAL_STRINGS': 'NO', # No -mpascal-strings + 'PREBINDING': 'NO', # No -Wl,-prebind + 'USE_HEADERMAP': 'NO', + 'OTHER_CFLAGS': [ + '-fembed-bitcode', + '-fno-strict-aliasing', + ], + 'WARNING_CFLAGS': [ + '-Wall', + '-Wendif-labels', + '-W', + '-Wno-unused-parameter', + ], + }, 'targets': [ { - 'target_name': 'version-min-4.3', + 'target_name': 'iphoneos-version-min-8.0', + 'type': 'executable', + 'mac_bundle': 1, + 'sources': [ 'check-version-min.c', ], + 'defines': [ 'GYPTEST_IOS_VERSION_MIN=__IPHONE_8_0', ], + 'xcode_settings': { + 'ARCHS': ['arm64'], + 'SDKROOT': 'iphoneos', + 'IPHONEOS_DEPLOYMENT_TARGET': '8.0', + }, + 'target_conditions': [ + ['_type!="static_library"', { + 'xcode_settings': { + 'OTHER_LDFLAGS': [ + '-Wl,-search_paths_first', + '-fembed-bitcode', + ], + }, + }], + ], + }, + { + 'target_name': 'libiphoneos-version-min-8.0', + 'type': 'static_library', + 'sources': [ 'check-version-min.c', ], + 'defines': [ 'GYPTEST_IOS_VERSION_MIN=__IPHONE_8_0', ], + 'xcode_settings': { + 'ARCHS': ['arm64'], + 'SDKROOT': 'iphoneos', + 'IPHONEOS_DEPLOYMENT_TARGET': '8.0', + }, + 'target_conditions': [ + ['_type!="static_library"', { + 'xcode_settings': { + 'OTHER_LDFLAGS': [ + '-Wl,-search_paths_first', + '-fembed-bitcode', + ], + }, + }], + ], + }, + { + 'target_name': 'libiphonesimulator-version-min-8.0', 'type': 'static_library', 'sources': [ 'check-version-min.c', ], - 'defines': [ 'GYPTEST_IOS_VERSION_MIN=40300', ], + 'defines': [ 'GYPTEST_IOS_VERSION_MIN=__IPHONE_8_0', ], 'xcode_settings': { - 'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0', + 'ARCHS': ['x86_64'], + 'SDKROOT': 'iphonesimulator', + 'IPHONEOS_DEPLOYMENT_TARGET': '8.0', + }, + 'target_conditions': [ + ['_type!="static_library"', { + 'xcode_settings': { + 'OTHER_LDFLAGS': [ + '-Wl,-search_paths_first', + '-fembed-bitcode', + ], + }, + }], + ], + }, + { + 'target_name': 'iphoneos-version-min-12.0', + 'type': 'executable', + 'mac_bundle': 1, + 'sources': [ 'check-version-min.c', ], + 'defines': [ 'GYPTEST_IOS_VERSION_MIN=__IPHONE_12_0', ], + 'xcode_settings': { + 'ARCHS': ['arm64'], 'SDKROOT': 'iphoneos', - 'IPHONEOS_DEPLOYMENT_TARGET': '4.3', + 'IPHONEOS_DEPLOYMENT_TARGET': '12.0', }, + 'target_conditions': [ + ['_type!="static_library"', { + 'xcode_settings': { + 'OTHER_LDFLAGS': [ + '-Wl,-search_paths_first', + '-fembed-bitcode', + ], + }, + }], + ], }, { - 'target_name': 'version-min-5.0', + 'target_name': 'libiphoneos-version-min-12.0', 'type': 'static_library', 'sources': [ 'check-version-min.c', ], - 'defines': [ 'GYPTEST_IOS_VERSION_MIN=50000', ], + 'defines': [ 'GYPTEST_IOS_VERSION_MIN=__IPHONE_12_0', ], 'xcode_settings': { - 'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0', + 'ARCHS': ['arm64'], 'SDKROOT': 'iphoneos', - 'IPHONEOS_DEPLOYMENT_TARGET': '5.0', + 'IPHONEOS_DEPLOYMENT_TARGET': '12.0', }, - } + 'target_conditions': [ + ['_type!="static_library"', { + 'xcode_settings': { + 'OTHER_LDFLAGS': [ + '-Wl,-search_paths_first', + '-fembed-bitcode', + ], + }, + }], + ], + }, + { + 'target_name': 'libiphonesimulator-version-min-12.0', + 'type': 'static_library', + 'sources': [ 'check-version-min.c', ], + 'defines': [ 'GYPTEST_IOS_VERSION_MIN=__IPHONE_12_0', ], + 'xcode_settings': { + 'ARCHS': ['x86_64'], + 'SDKROOT': 'iphonesimulator', + 'IPHONEOS_DEPLOYMENT_TARGET': '12.0', + }, + 'target_conditions': [ + ['_type!="static_library"', { + 'xcode_settings': { + 'OTHER_LDFLAGS': [ + '-Wl,-search_paths_first', + '-fembed-bitcode', + ], + }, + }], + ], + }, ], } diff --git a/test/ios/gyptest-archs.py b/test/ios/gyptest-archs.py index 8c2f86a8..a0d019e7 100644 --- a/test/ios/gyptest-archs.py +++ b/test/ios/gyptest-archs.py @@ -20,19 +20,19 @@ test.skip_test() # bug=532 test_cases = [ - ('Default', 'TestArch32Bits', ['i386']), + ('Default-iphonesimulator', 'TestArch32Bits', ['i386']), ('Default-iphoneos', 'TestArch32Bits', ['armv7']), ] if XCodeDetect.XCodeDetect.Version() < '0510': test_cases.extend([ - ('Default', 'TestNoArchs', ['i386']), + ('Default-iphonesimulator', 'TestNoArchs', ['i386']), ('Default-iphoneos', 'TestNoArchs', ['armv7'])]) if XCodeDetect.XCodeDetect.Version() >= '0500': test_cases.extend([ - ('Default', 'TestArch64Bits', ['x86_64']), - ('Default', 'TestMultiArchs', ['i386', 'x86_64']), + ('Default-iphonesimulator', 'TestArch64Bits', ['x86_64']), + ('Default-iphonesimulator', 'TestMultiArchs', ['i386', 'x86_64']), ('Default-iphoneos', 'TestArch64Bits', ['arm64']), ('Default-iphoneos', 'TestMultiArchs', ['armv7', 'arm64'])])