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

various ios fixes and test cases #45

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions gyp/XCodeDetect.py
Original file line number Diff line number Diff line change
Expand Up @@ -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']
1 change: 1 addition & 0 deletions gyp/xcode_emulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion test/ios/app-bundle/test.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -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',
},
},
Expand Down
152 changes: 139 additions & 13 deletions test/ios/deployment-target/deployment-target.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -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',
],
},
}],
],
},
],
}

8 changes: 4 additions & 4 deletions test/ios/gyptest-archs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'])])

Expand Down