Link with component build shared libraries

This commit is contained in:
Cheng Zhao 2015-04-02 14:05:43 +08:00
parent 19198a579a
commit 7e41b9e44d
5 changed files with 39 additions and 46 deletions

View file

@ -2,9 +2,6 @@
'includes': [ 'includes': [
'brightray.gypi', 'brightray.gypi',
], ],
'variables': {
'brightray_source_root': '<!(["python", "tools/brightray_source_root.py"])',
},
'targets': [ 'targets': [
{ {
'target_name': 'brightray', 'target_name': 'brightray',
@ -106,8 +103,8 @@
'<!@(pkg-config --libs-only-L --libs-only-other gtk+-2.0 libnotify dbus-1 x11 xrandr xext gconf-2.0)', '<!@(pkg-config --libs-only-L --libs-only-other gtk+-2.0 libnotify dbus-1 x11 xrandr xext gconf-2.0)',
], ],
'libraries': [ 'libraries': [
'<(brightray_source_root)/<(libchromiumcontent_library_dir)/libchromiumcontent.so', '<@(libchromiumcontent_shared_libraries)',
'<(brightray_source_root)/<(libchromiumcontent_library_dir)/libchromiumviews.a', '<(libchromiumcontent_library_dir)/libchromiumviews.a',
'-lpthread', '-lpthread',
'<!@(pkg-config --libs-only-l gtk+-2.0 libnotify dbus-1 x11 xrandr xext gconf-2.0)', '<!@(pkg-config --libs-only-l gtk+-2.0 libnotify dbus-1 x11 xrandr xext gconf-2.0)',
], ],
@ -116,7 +113,7 @@
['OS=="mac"', { ['OS=="mac"', {
'link_settings': { 'link_settings': {
'libraries': [ 'libraries': [
'<(brightray_source_root)/<(libchromiumcontent_library_dir)/libchromiumcontent.dylib', '<@(libchromiumcontent_shared_libraries)',
'$(SDKROOT)/System/Library/Frameworks/AppKit.framework', '$(SDKROOT)/System/Library/Frameworks/AppKit.framework',
], ],
}, },
@ -124,10 +121,11 @@
['OS=="win"', { ['OS=="win"', {
'link_settings': { 'link_settings': {
'libraries': [ 'libraries': [
'<(brightray_source_root)/<(libchromiumcontent_library_dir)/base_static.lib', '<@(libchromiumcontent_shared_libraries)',
'<(brightray_source_root)/<(libchromiumcontent_library_dir)/chromiumcontent.dll.lib', '<(libchromiumcontent_library_dir)/base_static.lib',
'<(brightray_source_root)/<(libchromiumcontent_library_dir)/chromiumviews.lib', '<(libchromiumcontent_library_dir)/chromiumcontent.dll.lib',
'<(brightray_source_root)/<(libchromiumcontent_library_dir)/sandbox_static.lib', '<(libchromiumcontent_library_dir)/chromiumviews.lib',
'<(libchromiumcontent_library_dir)/sandbox_static.lib',
], ],
}, },
}], }],

View file

@ -1,10 +1,13 @@
{ {
'includes': [
'vendor/download/libchromiumcontent/filenames.gypi',
],
'variables': { 'variables': {
'libchromiumcontent_dir': 'vendor/download/libchromiumcontent',
'libchromiumcontent_library_dir': '<(libchromiumcontent_dir)/Release', 'libchromiumcontent_library_dir': '<(libchromiumcontent_dir)/Release',
'libchromiumcontent_include_dir': '<(libchromiumcontent_dir)/src', 'libchromiumcontent_include_dir': '<(libchromiumcontent_dir)/src',
'libchromiumcontent_resources_dir': '<(libchromiumcontent_library_dir)', 'libchromiumcontent_resources_dir': '<(libchromiumcontent_library_dir)',
'libchromiumcontent_src_dir': '<(libchromiumcontent_dir)/src', 'libchromiumcontent_src_dir': '<(libchromiumcontent_dir)/src',
'mac_deployment_target%': '10.8', 'mac_deployment_target%': '10.8',
'mac_sdkroot%': 'macosx', 'mac_sdkroot%': 'macosx',
@ -72,7 +75,7 @@
'SK_IGNORE_GPU_DITHER', 'SK_IGNORE_GPU_DITHER',
], ],
'msvs_configuration_attributes': { 'msvs_configuration_attributes': {
'OutputDirectory': '<(DEPTH)\\build\\$(ConfigurationName)', 'OutputDirectory': '<(DEPTH)\\build\\$(ConfigurationName)',
'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)', 'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)',
'CharacterSet': '1', 'CharacterSet': '1',
}, },

View file

@ -13,42 +13,43 @@ DOWNLOAD_DIR = os.path.join(VENDOR_DIR, 'download')
def main(): def main():
args = parse_args() args = parse_args()
return (update_submodules() or return (update_submodules() or
download_libchromiumcontent(args.commit, args.url)) download_libchromiumcontent(args.commit, args.url))
def parse_args(): def parse_args():
parser = argparse.ArgumentParser(description='Bootstrap this project') parser = argparse.ArgumentParser(description='Bootstrap this project')
parser.add_argument('-c', '--commit', nargs='?', default='HEAD', parser.add_argument('-c', '--commit', nargs='?', default='HEAD',
help='The commit of libchromiumcontent to download.') help='The commit of libchromiumcontent to download.')
parser.add_argument('url', help='The base URL from which to download ' parser.add_argument('url', help='The base URL from which to download '
'libchromiumcontent (i.e., the URL you passed to ' 'libchromiumcontent (i.e., the URL you passed to '
'libchromiumcontent\'s script/upload script') 'libchromiumcontent\'s script/upload script')
return parser.parse_args() return parser.parse_args()
def update_submodules(): def update_submodules():
return (subprocess.call(['git', 'submodule', 'sync', '--quiet']) or return
subprocess.call(['git', 'submodule', 'update', '--init', return (subprocess.call(['git', 'submodule', 'sync', '--quiet']) or
'--recursive'])) subprocess.call(['git', 'submodule', 'update', '--init',
'--recursive']))
def download_libchromiumcontent(commit, url): def download_libchromiumcontent(commit, url):
mkdir_p(DOWNLOAD_DIR) mkdir_p(DOWNLOAD_DIR)
download = os.path.join(VENDOR_DIR, 'libchromiumcontent', 'script', download = os.path.join(VENDOR_DIR, 'libchromiumcontent', 'script',
'download') 'download')
return subprocess.call([sys.executable, download, '-f', '-c', commit, url, return subprocess.call([sys.executable, download, '-f', '-c', commit, url,
os.path.join(DOWNLOAD_DIR, 'libchromiumcontent')]) os.path.join(DOWNLOAD_DIR, 'libchromiumcontent')])
def mkdir_p(path): def mkdir_p(path):
try: try:
os.makedirs(path) os.makedirs(path)
except OSError as e: except OSError as e:
if e.errno != errno.EEXIST: if e.errno != errno.EEXIST:
raise raise
if __name__ == '__main__': if __name__ == '__main__':
sys.exit(main()) sys.exit(main())

View file

@ -1,9 +0,0 @@
#!/usr/bin/env python
import os
"""Prints the absolute path of the root of brightray's source tree.
"""
print os.path.abspath(os.path.dirname(os.path.dirname(__file__)))

@ -1 +1 @@
Subproject commit cb8ec5790c07bad7c11e8fb16e767ccef7f50ecb Subproject commit e19d6d778ff3c574906b832102783cb80f5a43c1