Enable ObjC build by default and reenable 64-bit mac libjingle build

BUG=2124
TESTED=trybots & building for mac, mac64, ios-sim, and ios-device on my MBP all build everything in out/Debug.
R=niklas.enbom@webrtc.org, wu@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/2080004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@4620 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
fischman@webrtc.org 2013-08-26 19:31:21 +00:00
parent 4498d013f6
commit e3de6b1e90
7 changed files with 87 additions and 120 deletions

14
all.gyp
View File

@ -14,17 +14,9 @@
'type': 'none', 'type': 'none',
'dependencies': [ 'dependencies': [
'webrtc/webrtc.gyp:*', 'webrtc/webrtc.gyp:*',
], 'talk/libjingle.gyp:*',
# TODO(henrike): fix build errors on 64 bit Mac for libjingle. See issue 'talk/libjingle_examples.gyp:*',
# 2124. Once done the entire conditional below can be removed. 'talk/libjingle_tests.gyp:*',
'conditions': [
['OS!="mac" or target_arch!="x64" or libjingle_objc==1', {
'dependencies': [
'talk/libjingle.gyp:*',
'talk/libjingle_examples.gyp:*',
'talk/libjingle_tests.gyp:*',
],
}],
], ],
}, },
], ],

View File

@ -2,26 +2,26 @@
# libjingle # libjingle
# Copyright 2012, Google Inc. # Copyright 2012, Google Inc.
# #
# Redistribution and use in source and binary forms, with or without # Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met: # modification, are permitted provided that the following conditions are met:
# #
# 1. Redistributions of source code must retain the above copyright notice, # 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer. # this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright notice, # 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation # this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution. # and/or other materials provided with the distribution.
# 3. The name of the author may not be used to endorse or promote products # 3. The name of the author may not be used to endorse or promote products
# derived from this software without specific prior written permission. # derived from this software without specific prior written permission.
# #
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, # EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# #
@ -36,8 +36,6 @@
# flood of chromium-style warnings. # flood of chromium-style warnings.
'clang_use_chrome_plugins%': 0, 'clang_use_chrome_plugins%': 0,
'libpeer_target_type%': 'static_library', 'libpeer_target_type%': 'static_library',
# Whether or not to build the ObjectiveC PeerConnection API & tests.
'libjingle_objc%': 0,
'conditions': [ 'conditions': [
['OS=="android" or OS=="linux"', { ['OS=="android" or OS=="linux"', {
# TODO(henrike): make sure waterfall bots have $JAVA_HOME configured # TODO(henrike): make sure waterfall bots have $JAVA_HOME configured
@ -110,7 +108,7 @@
'HAVE_OPENSSL_SSL_H=1', 'HAVE_OPENSSL_SSL_H=1',
], ],
}], }],
['libjingle_objc==1', { ['OS=="ios" or (OS=="mac" and target_arch!="ia32")', {
'defines': [ 'defines': [
'CARBON_DEPRECATED=YES', 'CARBON_DEPRECATED=YES',
], ],

View File

@ -42,7 +42,6 @@
}], }],
], ],
}], }],
['OS=="linux" or OS=="android"', { ['OS=="linux" or OS=="android"', {
'targets': [ 'targets': [
{ {
@ -150,7 +149,7 @@
}, },
], ],
}], }],
['libjingle_objc == 1', { ['OS=="ios" or (OS=="mac" and target_arch!="ia32")', {
'targets': [ 'targets': [
{ {
'target_name': 'libjingle_peerconnection_objc', 'target_name': 'libjingle_peerconnection_objc',
@ -234,8 +233,8 @@
'xcode_settings': { 'xcode_settings': {
'CLANG_ENABLE_OBJC_ARC': 'YES', 'CLANG_ENABLE_OBJC_ARC': 'YES',
}, },
} }, # target libjingle_peerconnection_objc
] ],
}], }],
], ],
@ -591,17 +590,6 @@
], ],
}], }],
['OS=="mac"', { ['OS=="mac"', {
'conditions': [
['libjingle_objc != 1', {
'link_settings' :{
'xcode_settings': {
'OTHER_LDFLAGS': [
'-framework Carbon',
],
},
},
}],
],
'sources': [ 'sources': [
'base/macasyncsocket.cc', 'base/macasyncsocket.cc',
'base/macasyncsocket.h', 'base/macasyncsocket.h',
@ -619,18 +607,36 @@
], ],
'link_settings': { 'link_settings': {
'libraries': [ 'libraries': [
'$(SDKROOT)/usr/lib/libcrypto.dylib', '$(SDKROOT)/usr/lib/libcrypto.dylib',
'$(SDKROOT)/usr/lib/libssl.dylib', '$(SDKROOT)/usr/lib/libssl.dylib',
], ],
'xcode_settings': { },
'OTHER_LDFLAGS': [ 'all_dependent_settings': {
'-framework Cocoa', 'link_settings': {
'-framework IOKit', 'xcode_settings': {
'-framework Security', 'OTHER_LDFLAGS': [
'-framework SystemConfiguration', '-framework Cocoa',
], '-framework Foundation',
'-framework IOKit',
'-framework Security',
'-framework SystemConfiguration',
],
},
}, },
}, },
'conditions': [
['target_arch=="ia32"', {
'all_dependent_settings': {
'link_settings': {
'xcode_settings': {
'OTHER_LDFLAGS': [
'-framework Carbon',
],
},
},
},
}],
],
}], }],
['OS=="ios"', { ['OS=="ios"', {
'sources': [ 'sources': [
@ -639,13 +645,16 @@
'dependencies': [ 'dependencies': [
'../net/third_party/nss/ssl.gyp:libssl', '../net/third_party/nss/ssl.gyp:libssl',
], ],
'xcode_settings': { 'all_dependent_settings': {
'OTHER_LDFLAGS': [ 'xcode_settings': {
'-framework IOKit', 'OTHER_LDFLAGS': [
'-framework Security', '-framework Foundation',
'-framework SystemConfiguration', '-framework IOKit',
'-framework UIKit', '-framework Security',
], '-framework SystemConfiguration',
'-framework UIKit',
],
},
}, },
}], }],
['OS=="win"', { ['OS=="win"', {
@ -903,12 +912,18 @@
'media/devices/macdevicemanagermm.mm', 'media/devices/macdevicemanagermm.mm',
], ],
'conditions': [ 'conditions': [
# TODO(hughv): Investigate if this is needed. ['target_arch=="ia32"', {
[ 'libjingle_objc != 1', {
'sources': [ 'sources': [
'media/devices/carbonvideorenderer.cc', 'media/devices/carbonvideorenderer.cc',
'media/devices/carbonvideorenderer.h', 'media/devices/carbonvideorenderer.h',
], ],
'link_settings': {
'xcode_settings': {
'OTHER_LDFLAGS': [
'-framework Carbon',
],
},
},
}], }],
], ],
'xcode_settings': { 'xcode_settings': {

View File

@ -218,7 +218,7 @@
], # targets ], # targets
}], # OS=="linux" or OS=="win" }], # OS=="linux" or OS=="win"
['libjingle_objc==1 and OS=="ios"', { ['OS=="ios"', {
'targets': [ 'targets': [
{ {
'target_name': 'AppRTCDemo', 'target_name': 'AppRTCDemo',
@ -276,17 +276,23 @@
# we could pick more intelligently among the keys, but as a # we could pick more intelligently among the keys, but as a
# first cut just tell the developer to specify a key identity # first cut just tell the developer to specify a key identity
# explicitly. # explicitly.
'ensure_single_key': '<!(python -c "assert len(\'\'\'<(key_id)\'\'\') > 0 and \'\\n\' not in \'\'\'<(key_id)\'\'\', \'key_id gyp variable needs to be set explicitly because there are multiple codesigning keys, or none!\'")', 'ensure_single_key': '<!(python -c "assert \'\\n\' not in \'\'\'<(key_id)\'\'\', \'key_id gyp variable needs to be set explicitly because there are multiple codesigning keys!\'")',
}, },
'action': [ 'conditions': [
'/usr/bin/codesign', '-v', '--force', '--sign', '<(key_id)', ['key_id==""', {
'${BUILT_PRODUCTS_DIR}/AppRTCDemo.app', 'action': [ 'echo', 'Skipping signing' ],
}, {
'action': [
'/usr/bin/codesign', '-v', '--force', '--sign', '<(key_id)',
'${BUILT_PRODUCTS_DIR}/AppRTCDemo.app',
],
}],
], ],
}, },
], ],
}, # target AppRTCDemo }, # target AppRTCDemo
], # targets ], # targets
}], # libjingle_objc==1 }], # OS=="ios"
['OS=="android"', { ['OS=="android"', {
'targets': [ 'targets': [

View File

@ -464,13 +464,16 @@
}, },
], ],
}], }],
['libjingle_objc == 1', { ['OS=="ios" or (OS=="mac" and target_arch!="ia32" and mac_sdk>="10.7")', {
# The >=10.7 above is required to make ARC link cleanly (e.g. as
# opposed to _compile_ cleanly, which the library under test
# does just fine on 10.6 too).
'targets': [ 'targets': [
{ {
'target_name': 'libjingle_peerconnection_objc_test',
'variables': { 'variables': {
'infoplist_file': './app/webrtc/objctests/Info.plist', 'infoplist_file': './app/webrtc/objctests/Info.plist',
}, },
'target_name': 'libjingle_peerconnection_objc_test',
'type': 'executable', 'type': 'executable',
'mac_bundle': 1, 'mac_bundle': 1,
'mac_bundle_resources': [ 'mac_bundle_resources': [
@ -510,7 +513,7 @@
], ],
}], }],
], ],
}, }, # target libjingle_peerconnection_objc_test
], ],
}], }],
], ],

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/bin/bash -e
# Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. # Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
# #
@ -8,66 +8,18 @@
# in the file PATENTS. All contributing project authors may # in the file PATENTS. All contributing project authors may
# be found in the AUTHORS file in the root of the source tree. # be found in the AUTHORS file in the root of the source tree.
function build_project() { # Work in trunk/.
# make the target string cd "$(dirname $0)/../.."
if [[ -z "$2" ]]; then
target_string=""
else
declare -a arg_target=("${!2}")
for item in ${arg_target[*]} export GYP_DEFINES="build_with_libjingle=1 build_with_chromium=0"
do GYP_DEFINES="$GYP_DEFINES OS=ios target_arch=armv7 key_id=\"\""
temp_string="-target $item " export GYP_GENERATORS="ninja"
target_string=$target_string$temp_string export GYP_CROSSCOMPILE=1
done
fi
# xcodebuild
xcodebuild -project "$1" -sdk iphoneos \
-configuration ${CONFIGURATION} \
-CONFIGURATION_BUILD_DIR=${CONFIGURATION_BUILD_DIR} $target_string
if [ "$?" != "0" ]; then
echo "[Error] build $1 failed!" 1>&2
echo "@@@STEP_FAILURE@@@"
exit 1
fi
}
# change the working directory to trunk
cd "$( dirname "${BASH_SOURCE[0]}" )/../.."
# build setting
CONFIGURATION_BUILD_DIR=./xcodebuild
CONFIGURATION=Debug
GYPDEF="OS=ios target_arch=arm armv7=1 arm_neon=1 enable_video=0 include_opus=1"
export GYP_DEFINES=$GYPDEF
echo "[Running gclient runhooks...]"
echo "@@@BUILD_STEP runhooks@@@" echo "@@@BUILD_STEP runhooks@@@"
gclient runhooks gclient runhooks || { echo "@@@STEP_FAILURE@@@"; exit 2; }
if [ "$?" != "0" ]; then
echo "[Error] gclient runhooks failed!" 1>&2
echo "@@@STEP_FAILURE@@@"
exit 2
fi
echo "[Projects updated]\n"
echo "@@@BUILD_STEP compile@@@" echo "@@@BUILD_STEP compile@@@"
echo "[Building XCode projects...]" ninja -C out/Debug || { echo "@@@STEP_FAILURE@@@"; exit 2; }
array_target_module=(
"bitrate_controller" "media_file" "paced_sender" "remote_bitrate_estimator"
"webrtc_utility" "rtp_rtcp" "CNG" "G711" "G722" "iLBC" "iSACFix" "PCM16B"
"audio_coding_module" "NetEq" "audio_conference_mixer" "audio_device"
"audio_processing" "iSAC" "isac_neon" "audio_processing_neon" "webrtc_opus"
)
array_target_opus=("opus")
build_project "webrtc/common_audio/common_audio.xcodeproj"
build_project "webrtc/modules/modules.xcodeproj" array_target_module[@]
build_project "webrtc/system_wrappers/source/system_wrappers.xcodeproj"
build_project "webrtc/voice_engine/voice_engine.xcodeproj"
build_project "third_party/opus/opus.xcodeproj" array_target_opus[@]
echo "[Building XCode projects is successful]\n"
exit 0 exit 0

View File

@ -132,6 +132,7 @@
'-framework AVFoundation', '-framework AVFoundation',
'-framework CoreMedia', '-framework CoreMedia',
'-framework CoreVideo', '-framework CoreVideo',
'-framework UIKit',
], ],
}, },
}, },