- Windows: Fix ninja build (issue #922).
- Update make_distrib.py to support ninja builds via a new "ninja-build" flag (issue #922). git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1193 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
parent
f0cdfd8dd2
commit
e98c1c41a8
43
cef.gyp
43
cef.gyp
|
@ -422,34 +422,6 @@
|
||||||
'type': 'shared_library',
|
'type': 'shared_library',
|
||||||
'msvs_guid': 'C13650D5-CF1A-4259-BE45-B1EBA6280E47',
|
'msvs_guid': 'C13650D5-CF1A-4259-BE45-B1EBA6280E47',
|
||||||
'dependencies': [
|
'dependencies': [
|
||||||
'<(DEPTH)/content/content.gyp:content_app',
|
|
||||||
'<(DEPTH)/content/content.gyp:content_browser',
|
|
||||||
'<(DEPTH)/content/content.gyp:content_common',
|
|
||||||
'<(DEPTH)/content/content.gyp:content_gpu',
|
|
||||||
'<(DEPTH)/content/content.gyp:content_plugin',
|
|
||||||
'<(DEPTH)/content/content.gyp:content_ppapi_plugin',
|
|
||||||
'<(DEPTH)/content/content.gyp:content_renderer',
|
|
||||||
'<(DEPTH)/content/content.gyp:content_utility',
|
|
||||||
'<(DEPTH)/content/content.gyp:content_worker',
|
|
||||||
'<(DEPTH)/content/content_resources.gyp:content_resources',
|
|
||||||
'<(DEPTH)/base/base.gyp:base',
|
|
||||||
'<(DEPTH)/base/base.gyp:base_prefs',
|
|
||||||
'<(DEPTH)/base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
|
|
||||||
'<(DEPTH)/build/temp_gyp/googleurl.gyp:googleurl',
|
|
||||||
'<(DEPTH)/ipc/ipc.gyp:ipc',
|
|
||||||
'<(DEPTH)/media/media.gyp:media',
|
|
||||||
'<(DEPTH)/net/net.gyp:net',
|
|
||||||
'<(DEPTH)/net/net.gyp:net_with_v8',
|
|
||||||
'<(DEPTH)/skia/skia.gyp:skia',
|
|
||||||
'<(DEPTH)/third_party/libxml/libxml.gyp:libxml',
|
|
||||||
'<(DEPTH)/third_party/WebKit/Source/WebCore/WebCore.gyp/WebCore.gyp:webcore',
|
|
||||||
'<(DEPTH)/third_party/WebKit/Source/WebKit/chromium/WebKit.gyp:webkit',
|
|
||||||
'<(DEPTH)/third_party/zlib/zlib.gyp:minizip',
|
|
||||||
'<(DEPTH)/ui/gl/gl.gyp:gl',
|
|
||||||
'<(DEPTH)/ui/ui.gyp:ui',
|
|
||||||
'<(DEPTH)/v8/tools/gyp/v8.gyp:v8',
|
|
||||||
'<(DEPTH)/webkit/support/webkit_support.gyp:glue',
|
|
||||||
'<(DEPTH)/webkit/support/webkit_support.gyp:webkit_storage',
|
|
||||||
'libcef_static',
|
'libcef_static',
|
||||||
],
|
],
|
||||||
'defines': [
|
'defines': [
|
||||||
|
@ -458,12 +430,6 @@
|
||||||
'include_dirs': [
|
'include_dirs': [
|
||||||
'.',
|
'.',
|
||||||
],
|
],
|
||||||
# Avoid "RC1102: internal error : too many arguments to RCPP" error by
|
|
||||||
# explicitly specifying a short list of resource include directories.
|
|
||||||
'resource_include_dirs' : [
|
|
||||||
'.',
|
|
||||||
'..',
|
|
||||||
],
|
|
||||||
'sources': [
|
'sources': [
|
||||||
'<@(includes_common)',
|
'<@(includes_common)',
|
||||||
'<@(includes_capi)',
|
'<@(includes_capi)',
|
||||||
|
@ -487,6 +453,11 @@
|
||||||
'<(DEPTH)/base/allocator/allocator.gyp:allocator',
|
'<(DEPTH)/base/allocator/allocator.gyp:allocator',
|
||||||
],
|
],
|
||||||
}],
|
}],
|
||||||
|
['toolkit_uses_gtk == 1', {
|
||||||
|
'dependencies': [
|
||||||
|
'<(DEPTH)/build/linux/system.gyp:gtk',
|
||||||
|
],
|
||||||
|
}],
|
||||||
['OS=="win"', {
|
['OS=="win"', {
|
||||||
'configurations': {
|
'configurations': {
|
||||||
'Debug_Base': {
|
'Debug_Base': {
|
||||||
|
@ -501,8 +472,8 @@
|
||||||
'<@(includes_win)',
|
'<@(includes_win)',
|
||||||
# TODO(cef): Remove ui_unscaled_resources.rc once custom cursor
|
# TODO(cef): Remove ui_unscaled_resources.rc once custom cursor
|
||||||
# resources can be loaded via ResourceBundle. See crbug.com/147663.
|
# resources can be loaded via ResourceBundle. See crbug.com/147663.
|
||||||
'$(OutDir)/obj/global_intermediate/webkit/webkit_resources.rc',
|
'<(SHARED_INTERMEDIATE_DIR)/webkit/webkit_resources.rc',
|
||||||
'$(OutDir)/obj/global_intermediate/ui/ui_resources/ui_unscaled_resources.rc',
|
'<(SHARED_INTERMEDIATE_DIR)/ui/ui_resources/ui_unscaled_resources.rc',
|
||||||
'libcef_dll/libcef_dll.rc',
|
'libcef_dll/libcef_dll.rc',
|
||||||
],
|
],
|
||||||
'link_settings': {
|
'link_settings': {
|
||||||
|
|
|
@ -101,6 +101,7 @@ def transfer_files(cef_dir, script_dir, transfer_cfg, output_dir, quiet):
|
||||||
def generate_msvs_projects(version):
|
def generate_msvs_projects(version):
|
||||||
""" Generate MSVS projects for the specified version. """
|
""" Generate MSVS projects for the specified version. """
|
||||||
sys.stdout.write('Generating '+version+' project files...')
|
sys.stdout.write('Generating '+version+' project files...')
|
||||||
|
os.environ['GYP_GENERATORS'] = 'msvs'
|
||||||
os.environ['GYP_MSVS_VERSION'] = version
|
os.environ['GYP_MSVS_VERSION'] = version
|
||||||
gyper = [ 'python', 'tools/gyp_cef', os.path.relpath(os.path.join(output_dir, 'cefclient.gyp'), cef_dir) ]
|
gyper = [ 'python', 'tools/gyp_cef', os.path.relpath(os.path.join(output_dir, 'cefclient.gyp'), cef_dir) ]
|
||||||
RunAction(cef_dir, gyper);
|
RunAction(cef_dir, gyper);
|
||||||
|
@ -165,6 +166,9 @@ parser.add_option('--allow-partial',
|
||||||
parser.add_option('--no-symbols',
|
parser.add_option('--no-symbols',
|
||||||
action='store_true', dest='nosymbols', default=False,
|
action='store_true', dest='nosymbols', default=False,
|
||||||
help='do not create symbol files')
|
help='do not create symbol files')
|
||||||
|
parser.add_option('--ninja-build',
|
||||||
|
action='store_true', dest='ninjabuild', default=False,
|
||||||
|
help='build was created using ninja')
|
||||||
parser.add_option('-q', '--quiet',
|
parser.add_option('-q', '--quiet',
|
||||||
action='store_true', dest='quiet', default=False,
|
action='store_true', dest='quiet', default=False,
|
||||||
help='do not output detailed status information')
|
help='do not output detailed status information')
|
||||||
|
@ -296,9 +300,16 @@ if platform == 'windows':
|
||||||
transfer_gypi_files(cef_dir, cef_paths2['cefclient_sources_win'], \
|
transfer_gypi_files(cef_dir, cef_paths2['cefclient_sources_win'], \
|
||||||
'tests/cefclient/', cefclient_dir, options.quiet)
|
'tests/cefclient/', cefclient_dir, options.quiet)
|
||||||
|
|
||||||
|
if options.ninjabuild:
|
||||||
|
out_dir = os.path.join(src_dir, 'out')
|
||||||
|
libcef_dll_file = 'libcef.dll.lib'
|
||||||
|
else:
|
||||||
|
out_dir = os.path.join(src_dir, 'build')
|
||||||
|
libcef_dll_file = 'lib/libcef.lib'
|
||||||
|
|
||||||
# transfer build/Debug files
|
# transfer build/Debug files
|
||||||
build_dir = os.path.join(src_dir, 'build/Debug');
|
build_dir = os.path.join(out_dir, 'Debug');
|
||||||
if not options.allowpartial or path_exists(build_dir):
|
if not options.allowpartial or path_exists(os.path.join(build_dir, 'cefclient.exe')):
|
||||||
dst_dir = os.path.join(output_dir, 'Debug')
|
dst_dir = os.path.join(output_dir, 'Debug')
|
||||||
make_dir(dst_dir, options.quiet)
|
make_dir(dst_dir, options.quiet)
|
||||||
copy_files(os.path.join(script_dir, 'distrib/win/*.dll'), dst_dir, options.quiet)
|
copy_files(os.path.join(script_dir, 'distrib/win/*.dll'), dst_dir, options.quiet)
|
||||||
|
@ -312,13 +323,14 @@ if platform == 'windows':
|
||||||
# transfer lib/Debug files
|
# transfer lib/Debug files
|
||||||
dst_dir = os.path.join(output_dir, 'lib/Debug')
|
dst_dir = os.path.join(output_dir, 'lib/Debug')
|
||||||
make_dir(dst_dir, options.quiet)
|
make_dir(dst_dir, options.quiet)
|
||||||
copy_file(os.path.join(build_dir, 'lib/libcef.lib'), dst_dir, options.quiet)
|
copy_file(os.path.join(build_dir, libcef_dll_file), os.path.join(dst_dir, 'libcef.lib'), \
|
||||||
|
options.quiet)
|
||||||
else:
|
else:
|
||||||
sys.stderr.write("No Debug build files.\n")
|
sys.stderr.write("No Debug build files.\n")
|
||||||
|
|
||||||
# transfer build/Release files
|
# transfer build/Release files
|
||||||
build_dir = os.path.join(src_dir, 'build/Release');
|
build_dir = os.path.join(out_dir, 'Release');
|
||||||
if not options.allowpartial or path_exists(build_dir):
|
if not options.allowpartial or path_exists(os.path.join(build_dir, 'cefclient.exe')):
|
||||||
dst_dir = os.path.join(output_dir, 'Release')
|
dst_dir = os.path.join(output_dir, 'Release')
|
||||||
make_dir(dst_dir, options.quiet)
|
make_dir(dst_dir, options.quiet)
|
||||||
copy_files(os.path.join(script_dir, 'distrib/win/*.dll'), dst_dir, options.quiet)
|
copy_files(os.path.join(script_dir, 'distrib/win/*.dll'), dst_dir, options.quiet)
|
||||||
|
@ -332,7 +344,8 @@ if platform == 'windows':
|
||||||
# transfer lib/Release files
|
# transfer lib/Release files
|
||||||
dst_dir = os.path.join(output_dir, 'lib/Release')
|
dst_dir = os.path.join(output_dir, 'lib/Release')
|
||||||
make_dir(dst_dir, options.quiet)
|
make_dir(dst_dir, options.quiet)
|
||||||
copy_file(os.path.join(build_dir, 'lib/libcef.lib'), dst_dir, options.quiet)
|
copy_file(os.path.join(build_dir, libcef_dll_file), os.path.join(dst_dir, 'libcef.lib'), \
|
||||||
|
options.quiet)
|
||||||
|
|
||||||
if not options.nosymbols:
|
if not options.nosymbols:
|
||||||
# transfer symbols
|
# transfer symbols
|
||||||
|
@ -378,20 +391,27 @@ elif platform == 'macosx':
|
||||||
copy_dir(os.path.join(cef_dir, 'tests/cefclient/mac/'), os.path.join(output_dir, 'cefclient/mac/'), \
|
copy_dir(os.path.join(cef_dir, 'tests/cefclient/mac/'), os.path.join(output_dir, 'cefclient/mac/'), \
|
||||||
options.quiet)
|
options.quiet)
|
||||||
|
|
||||||
|
if options.ninjabuild:
|
||||||
|
out_dir = os.path.join(src_dir, 'out')
|
||||||
|
else:
|
||||||
|
out_dir = os.path.join(src_dir, 'xcodebuild')
|
||||||
|
|
||||||
|
valid_build_dir = None
|
||||||
|
|
||||||
# transfer xcodebuild/Debug files
|
# transfer xcodebuild/Debug files
|
||||||
build_dir = os.path.join(src_dir, 'xcodebuild/Debug')
|
build_dir = os.path.join(out_dir, 'Debug')
|
||||||
if not options.allowpartial or path_exists(build_dir):
|
if not options.allowpartial or path_exists(os.path.join(build_dir, 'cefclient.app')):
|
||||||
|
valid_build_dir = build_dir
|
||||||
dst_dir = os.path.join(output_dir, 'Debug')
|
dst_dir = os.path.join(output_dir, 'Debug')
|
||||||
make_dir(dst_dir, options.quiet)
|
make_dir(dst_dir, options.quiet)
|
||||||
copy_file(os.path.join(build_dir, 'ffmpegsumo.so'), dst_dir, options.quiet)
|
copy_file(os.path.join(build_dir, 'ffmpegsumo.so'), dst_dir, options.quiet)
|
||||||
copy_file(os.path.join(build_dir, 'libcef.dylib'), dst_dir, options.quiet)
|
copy_file(os.path.join(build_dir, 'libcef.dylib'), dst_dir, options.quiet)
|
||||||
copy_file(os.path.join(build_dir, 'libplugin_carbon_interpose.dylib'), dst_dir, options.quiet)
|
copy_file(os.path.join(build_dir, 'libplugin_carbon_interpose.dylib'), dst_dir, options.quiet)
|
||||||
else:
|
|
||||||
build_dir = None
|
|
||||||
|
|
||||||
# transfer xcodebuild/Release files
|
# transfer xcodebuild/Release files
|
||||||
build_dir = os.path.join(src_dir, 'xcodebuild/Release')
|
build_dir = os.path.join(out_dir, 'Release')
|
||||||
if not options.allowpartial or path_exists(build_dir):
|
if not options.allowpartial or path_exists(os.path.join(build_dir, 'cefclient.app')):
|
||||||
|
valid_build_dir = build_dir
|
||||||
dst_dir = os.path.join(output_dir, 'Release')
|
dst_dir = os.path.join(output_dir, 'Release')
|
||||||
make_dir(dst_dir, options.quiet)
|
make_dir(dst_dir, options.quiet)
|
||||||
copy_file(os.path.join(build_dir, 'ffmpegsumo.so'), dst_dir, options.quiet)
|
copy_file(os.path.join(build_dir, 'ffmpegsumo.so'), dst_dir, options.quiet)
|
||||||
|
@ -404,11 +424,10 @@ elif platform == 'macosx':
|
||||||
src_path = os.path.join(build_dir, 'libcef.dylib.dSYM/Contents/Resources/DWARF/libcef.dylib')
|
src_path = os.path.join(build_dir, 'libcef.dylib.dSYM/Contents/Resources/DWARF/libcef.dylib')
|
||||||
dst_path = os.path.join(symbol_dir, 'libcef.dylib.dSYM')
|
dst_path = os.path.join(symbol_dir, 'libcef.dylib.dSYM')
|
||||||
run('dsymutil '+src_path+' -o '+dst_path, cef_dir)
|
run('dsymutil '+src_path+' -o '+dst_path, cef_dir)
|
||||||
else:
|
|
||||||
build_dir = None
|
|
||||||
|
|
||||||
if not build_dir is None:
|
if not valid_build_dir is None:
|
||||||
# transfer resource files
|
# transfer resource files
|
||||||
|
build_dir = valid_build_dir
|
||||||
dst_dir = os.path.join(output_dir, 'Resources')
|
dst_dir = os.path.join(output_dir, 'Resources')
|
||||||
make_dir(dst_dir, options.quiet)
|
make_dir(dst_dir, options.quiet)
|
||||||
copy_files(os.path.join(build_dir, 'cefclient.app/Contents/Frameworks/Chromium Embedded Framework.framework/Resources/*.*'), \
|
copy_files(os.path.join(build_dir, 'cefclient.app/Contents/Frameworks/Chromium Embedded Framework.framework/Resources/*.*'), \
|
||||||
|
@ -420,6 +439,7 @@ elif platform == 'macosx':
|
||||||
|
|
||||||
# Generate Xcode project files
|
# Generate Xcode project files
|
||||||
sys.stdout.write('Generating Xcode project files...')
|
sys.stdout.write('Generating Xcode project files...')
|
||||||
|
os.environ['GYP_GENERATORS'] = 'xcode'
|
||||||
gyper = [ 'python', 'tools/gyp_cef', os.path.relpath(os.path.join(output_dir, 'cefclient.gyp'), cef_dir) ]
|
gyper = [ 'python', 'tools/gyp_cef', os.path.relpath(os.path.join(output_dir, 'cefclient.gyp'), cef_dir) ]
|
||||||
RunAction(cef_dir, gyper);
|
RunAction(cef_dir, gyper);
|
||||||
|
|
||||||
|
@ -436,26 +456,37 @@ elif platform == 'linux':
|
||||||
create_readme(os.path.join(script_dir, 'distrib/linux/README.txt'), output_dir, cef_url, \
|
create_readme(os.path.join(script_dir, 'distrib/linux/README.txt'), output_dir, cef_url, \
|
||||||
cef_rev, cef_ver, chromium_url, chromium_rev, chromium_ver, date)
|
cef_rev, cef_ver, chromium_url, chromium_rev, chromium_ver, date)
|
||||||
|
|
||||||
|
out_dir = os.path.join(src_dir, 'out')
|
||||||
|
if options.ninjabuild:
|
||||||
|
lib_dir_name = 'lib'
|
||||||
|
else:
|
||||||
|
lib_dir_name = 'lib.target'
|
||||||
|
|
||||||
|
valid_build_dir = None
|
||||||
|
|
||||||
# transfer out/Debug files
|
# transfer out/Debug files
|
||||||
build_dir = os.path.join(src_dir, 'out/Debug');
|
build_dir = os.path.join(out_dir, 'Debug');
|
||||||
if not options.allowpartial or path_exists(build_dir):
|
if not options.allowpartial or path_exists(os.path.join(build_dir, 'cefclient')):
|
||||||
|
valid_build_dir = build_dir
|
||||||
dst_dir = os.path.join(output_dir, 'Debug')
|
dst_dir = os.path.join(output_dir, 'Debug')
|
||||||
make_dir(dst_dir, options.quiet)
|
make_dir(dst_dir, options.quiet)
|
||||||
copy_file(os.path.join(build_dir, 'lib.target/libcef.so'), dst_dir, options.quiet)
|
copy_file(os.path.join(build_dir, lib_dir_name, 'libcef.so'), dst_dir, options.quiet)
|
||||||
else:
|
else:
|
||||||
sys.stderr.write("No Debug build files.\n")
|
sys.stderr.write("No Debug build files.\n")
|
||||||
|
|
||||||
# transfer out/Release files
|
# transfer out/Release files
|
||||||
build_dir = os.path.join(src_dir, 'out/Release');
|
build_dir = os.path.join(out_dir, 'Release');
|
||||||
if not options.allowpartial or path_exists(build_dir):
|
if not options.allowpartial or path_exists(os.path.join(build_dir, 'cefclient')):
|
||||||
|
valid_build_dir = build_dir
|
||||||
dst_dir = os.path.join(output_dir, 'Release')
|
dst_dir = os.path.join(output_dir, 'Release')
|
||||||
make_dir(dst_dir, options.quiet)
|
make_dir(dst_dir, options.quiet)
|
||||||
copy_file(os.path.join(build_dir, 'lib.target/libcef.so'), dst_dir, options.quiet)
|
copy_file(os.path.join(build_dir, lib_dir_name, 'libcef.so'), dst_dir, options.quiet)
|
||||||
else:
|
else:
|
||||||
sys.stderr.write("No Release build files.\n")
|
sys.stderr.write("No Release build files.\n")
|
||||||
|
|
||||||
if not build_dir is None:
|
if not valid_build_dir is None:
|
||||||
# transfer resource files
|
# transfer resource files
|
||||||
|
build_dir = valid_build_dir
|
||||||
dst_dir = os.path.join(output_dir, 'Resources')
|
dst_dir = os.path.join(output_dir, 'Resources')
|
||||||
make_dir(dst_dir, options.quiet)
|
make_dir(dst_dir, options.quiet)
|
||||||
copy_file(os.path.join(build_dir, 'cef.pak'), dst_dir, options.quiet)
|
copy_file(os.path.join(build_dir, 'cef.pak'), dst_dir, options.quiet)
|
||||||
|
@ -477,21 +508,25 @@ elif platform == 'linux':
|
||||||
transfer_files(cef_dir, script_dir, os.path.join(script_dir, 'distrib/linux/transfer.cfg'), \
|
transfer_files(cef_dir, script_dir, os.path.join(script_dir, 'distrib/linux/transfer.cfg'), \
|
||||||
output_dir, options.quiet)
|
output_dir, options.quiet)
|
||||||
|
|
||||||
# Back up the existing Makefile
|
|
||||||
makefile = os.path.join(src_dir, 'Makefile')
|
makefile = os.path.join(src_dir, 'Makefile')
|
||||||
|
makefile_tmp = ''
|
||||||
|
if path_exists(makefile):
|
||||||
|
# Back up the existing Makefile
|
||||||
makefile_tmp = makefile + '.cef_bak'
|
makefile_tmp = makefile + '.cef_bak'
|
||||||
copy_file(makefile, makefile_tmp, options.quiet)
|
copy_file(makefile, makefile_tmp, options.quiet)
|
||||||
|
|
||||||
# Generate make project files
|
# Generate make project files
|
||||||
sys.stdout.write('Generating make project files...')
|
sys.stdout.write('Generating make project files...')
|
||||||
|
os.environ['GYP_GENERATORS'] = 'make'
|
||||||
gyper = [ 'python', 'tools/gyp_cef', os.path.relpath(os.path.join(output_dir, 'cefclient.gyp'), cef_dir) ]
|
gyper = [ 'python', 'tools/gyp_cef', os.path.relpath(os.path.join(output_dir, 'cefclient.gyp'), cef_dir) ]
|
||||||
RunAction(cef_dir, gyper);
|
RunAction(cef_dir, gyper);
|
||||||
|
|
||||||
# Copy the resulting Makefile to the destination directory
|
# Copy the resulting Makefile to the destination directory
|
||||||
copy_file(makefile, output_dir, options.quiet)
|
copy_file(makefile, output_dir, options.quiet)
|
||||||
|
|
||||||
# Restore the original Makefile
|
|
||||||
remove_file(makefile, options.quiet)
|
remove_file(makefile, options.quiet)
|
||||||
|
if makefile_tmp != '':
|
||||||
|
# Restore the original Makefile
|
||||||
move_file(makefile_tmp, makefile, options.quiet)
|
move_file(makefile_tmp, makefile, options.quiet)
|
||||||
|
|
||||||
# Post-process the make files
|
# Post-process the make files
|
||||||
|
|
Loading…
Reference in New Issue