From de08e6575b405c151f7941150c5c9a6bcf5d053c Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Thu, 2 Apr 2015 13:46:16 +0800 Subject: [PATCH 01/45] Upgrade libchromiumcontent for component build --- vendor/libchromiumcontent | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vendor/libchromiumcontent b/vendor/libchromiumcontent index bb32709..cb8ec57 160000 --- a/vendor/libchromiumcontent +++ b/vendor/libchromiumcontent @@ -1 +1 @@ -Subproject commit bb327098c5e365f478a66f101044b8fdd4e79aa6 +Subproject commit cb8ec5790c07bad7c11e8fb16e767ccef7f50ecb From a430d8f653602fd108094398b2ef79dc7126c819 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Thu, 2 Apr 2015 14:05:43 +0800 Subject: [PATCH 02/45] Link with component build shared libraries --- brightray.gyp | 18 ++++++------- brightray.gypi | 7 +++-- script/bootstrap | 49 +++++++++++++++++----------------- tools/brightray_source_root.py | 9 ------- vendor/libchromiumcontent | 2 +- 5 files changed, 39 insertions(+), 46 deletions(-) delete mode 100644 tools/brightray_source_root.py diff --git a/brightray.gyp b/brightray.gyp index df52343..6da645c 100644 --- a/brightray.gyp +++ b/brightray.gyp @@ -2,9 +2,6 @@ 'includes': [ 'brightray.gypi', ], - 'variables': { - 'brightray_source_root': ' Date: Thu, 2 Apr 2015 15:11:15 +0800 Subject: [PATCH 03/45] Only do component build in Debug mode --- brightray.gyp | 8 +++++--- brightray.gypi | 9 +++++++++ vendor/libchromiumcontent | 2 +- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/brightray.gyp b/brightray.gyp index 6da645c..2ce86b9 100644 --- a/brightray.gyp +++ b/brightray.gyp @@ -93,6 +93,11 @@ 'common/main_delegate_mac.mm', ], 'conditions': [ + ['libchromiumcontent_component_build', { + 'link_settings': { + 'libraries': [ '<@(libchromiumcontent_shared_libraries)' ] + }, + }], ['OS=="linux"', { 'cflags_cc': [ '-Wno-deprecated-register', @@ -103,7 +108,6 @@ ' Date: Thu, 2 Apr 2015 22:14:18 +0800 Subject: [PATCH 04/45] Set libraries' path according to libchromiumcontent_component variable --- brightray.gyp | 40 ++++---- brightray.gypi | 188 ++++++++++++++++++++------------------ vendor/libchromiumcontent | 2 +- 3 files changed, 119 insertions(+), 111 deletions(-) diff --git a/brightray.gyp b/brightray.gyp index 2ce86b9..9c5bbbf 100644 --- a/brightray.gyp +++ b/brightray.gyp @@ -8,22 +8,22 @@ 'type': 'static_library', 'include_dirs': [ '.', - '<(libchromiumcontent_include_dir)', - '<(libchromiumcontent_include_dir)/skia/config', - '<(libchromiumcontent_include_dir)/third_party/skia/include/core', - '<(libchromiumcontent_include_dir)/third_party/WebKit', - '<(libchromiumcontent_library_dir)/gen', + '<(libchromiumcontent_src_dir)', + '<(libchromiumcontent_src_dir)/skia/config', + '<(libchromiumcontent_src_dir)/third_party/skia/include/core', + '<(libchromiumcontent_src_dir)/third_party/WebKit', + '<(libchromiumcontent_dir)/gen', ], 'direct_dependent_settings': { 'include_dirs': [ '.', '..', - '<(libchromiumcontent_include_dir)', - '<(libchromiumcontent_include_dir)/skia/config', - '<(libchromiumcontent_include_dir)/third_party/skia/include/core', - '<(libchromiumcontent_include_dir)/third_party/icu/source/common', - '<(libchromiumcontent_include_dir)/third_party/WebKit', - '<(libchromiumcontent_library_dir)/gen', + '<(libchromiumcontent_src_dir)', + '<(libchromiumcontent_src_dir)/skia/config', + '<(libchromiumcontent_src_dir)/third_party/skia/include/core', + '<(libchromiumcontent_src_dir)/third_party/icu/source/common', + '<(libchromiumcontent_src_dir)/third_party/WebKit', + '<(libchromiumcontent_dir)/gen', ], }, 'sources': [ @@ -92,12 +92,10 @@ 'common/main_delegate.h', 'common/main_delegate_mac.mm', ], + 'link_settings': { + 'libraries': [ '<@(libchromiumcontent_libraries)' ] + }, 'conditions': [ - ['libchromiumcontent_component_build', { - 'link_settings': { - 'libraries': [ '<@(libchromiumcontent_shared_libraries)' ] - }, - }], ['OS=="linux"', { 'cflags_cc': [ '-Wno-deprecated-register', @@ -108,7 +106,7 @@ ' Date: Fri, 3 Apr 2015 09:56:03 +0800 Subject: [PATCH 05/45] mac: Link with all necessary system libraries --- brightray.gyp | 32 ++++++++++++++++++++++++++++++++ brightray.gypi | 15 ++++++++++----- 2 files changed, 42 insertions(+), 5 deletions(-) diff --git a/brightray.gyp b/brightray.gyp index 9c5bbbf..92b9b99 100644 --- a/brightray.gyp +++ b/brightray.gyp @@ -119,6 +119,38 @@ ], }, }], + ['OS=="mac" and libchromiumcontent_component==0', { + 'link_settings': { + 'libraries': [ + # ui_base.gypi: + '$(SDKROOT)/System/Library/Frameworks/Accelerate.framework', + # net.gypi: + '$(SDKROOT)/System/Library/Frameworks/Foundation.framework', + '$(SDKROOT)/System/Library/Frameworks/Security.framework', + '$(SDKROOT)/System/Library/Frameworks/SystemConfiguration.framework', + '$(SDKROOT)/usr/lib/libresolv.dylib', + # media.gyp: + '$(SDKROOT)/System/Library/Frameworks/AudioToolbox.framework', + '$(SDKROOT)/System/Library/Frameworks/AudioUnit.framework', + '$(SDKROOT)/System/Library/Frameworks/CoreAudio.framework', + '$(SDKROOT)/System/Library/Frameworks/CoreMIDI.framework', + '$(SDKROOT)/System/Library/Frameworks/CoreVideo.framework', + '$(SDKROOT)/System/Library/Frameworks/OpenGL.framework', + '$(SDKROOT)/System/Library/Frameworks/QTKit.framework', + # surface.gyp: + '$(SDKROOT)/System/Library/Frameworks/IOSurface.framework', + # content_common.gypi: + '$(SDKROOT)/System/Library/Frameworks/QuartzCore.framework', + # base.gyp: + '$(SDKROOT)/System/Library/Frameworks/ApplicationServices.framework', + '$(SDKROOT)/System/Library/Frameworks/Carbon.framework', + '$(SDKROOT)/System/Library/Frameworks/CoreFoundation.framework', + '$(SDKROOT)/System/Library/Frameworks/IOKit.framework', + # content_browser.gypi: + '$(SDKROOT)/usr/lib/libbsm.dylib', + ], + }, + }], ['OS=="win"', { 'link_settings': { 'libraries': [ diff --git a/brightray.gypi b/brightray.gypi index 6ce2a25..ed3328c 100644 --- a/brightray.gypi +++ b/brightray.gypi @@ -73,12 +73,8 @@ 'Common_Base': { 'abstract': 1, 'defines': [ - 'COMPONENT_BUILD', - 'GURL_DLL', - 'SKIA_DLL', + # We are using Release version libchromiumcontent: 'NDEBUG', - 'USING_V8_SHARED', - 'WEBKIT_DLL', # From skia_for_chromium_defines.gypi: 'SK_SUPPORT_LEGACY_GETTOPDEVICE', 'SK_SUPPORT_LEGACY_BITMAP_CONFIG', @@ -239,6 +235,15 @@ ], }, 'conditions': [ + ['libchromiumcontent_component', { + 'defines': [ + 'COMPONENT_BUILD', + 'GURL_DLL', + 'SKIA_DLL', + 'USING_V8_SHARED', + 'WEBKIT_DLL', + ], + }], ['OS=="linux" and linux_clang==1', { 'make_global_settings': [ ['CC', '/usr/bin/clang'], From ca993560286e14aa936d3cff415e2b317ba8faf0 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Fri, 3 Apr 2015 11:37:27 +0800 Subject: [PATCH 06/45] Link with libboringssl.dylib --- brightray.gyp | 3 +++ brightray.gypi | 2 -- vendor/libchromiumcontent | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/brightray.gyp b/brightray.gyp index 92b9b99..01ba60a 100644 --- a/brightray.gyp +++ b/brightray.gyp @@ -122,6 +122,9 @@ ['OS=="mac" and libchromiumcontent_component==0', { 'link_settings': { 'libraries': [ + # This library is built as shared library to avoid symbols + # conflict with Node. + '<(libchromiumcontent_dir)/libboringssl.dylib', # ui_base.gypi: '$(SDKROOT)/System/Library/Frameworks/Accelerate.framework', # net.gypi: diff --git a/brightray.gypi b/brightray.gypi index ed3328c..ac77770 100644 --- a/brightray.gypi +++ b/brightray.gypi @@ -10,11 +10,9 @@ ['libchromiumcontent_component', { 'libchromiumcontent_dir%': '<(libchromiumcontent_root_dir)/shared_library', 'libchromiumcontent_libraries%': '<(libchromiumcontent_shared_libraries)', - 'libchromiumcontent_shared_libraries': [], }, { 'libchromiumcontent_dir%': '<(libchromiumcontent_root_dir)/static_library', 'libchromiumcontent_libraries%': '<(libchromiumcontent_static_libraries)', - 'libchromiumcontent_static_libraries': [], }], ], diff --git a/vendor/libchromiumcontent b/vendor/libchromiumcontent index cbc562c..846a13a 160000 --- a/vendor/libchromiumcontent +++ b/vendor/libchromiumcontent @@ -1 +1 @@ -Subproject commit cbc562c7a9c6a2a56f3a6ba08652f5e475898d48 +Subproject commit 846a13ae2234490d78568a68f07f5be95c24c0c3 From f89e3f633ec0c9ead422d0a39f7f42e693544d08 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Fri, 3 Apr 2015 11:39:03 +0800 Subject: [PATCH 07/45] Use "D" and "R" as short names --- brightray.gypi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/brightray.gypi b/brightray.gypi index ac77770..43a1779 100644 --- a/brightray.gypi +++ b/brightray.gypi @@ -116,7 +116,7 @@ }, 'conditions': [ ['libchromiumcontent_component', { - 'RealDebug': { + 'D': { 'inherit_from': [ 'Common_Base', ], @@ -160,7 +160,7 @@ }, }, }, { - 'RealRelease': { + 'R': { 'inherit_from': [ 'Common_Base', ], From 5c1141338e1a6abee87583f708e61236ac2a9c35 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Sun, 5 Apr 2015 22:28:00 +0800 Subject: [PATCH 08/45] Download static_library build of libchromiumcontent --- script/bootstrap | 14 ++++++++++---- vendor/libchromiumcontent | 2 +- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/script/bootstrap b/script/bootstrap index e865c16..23b33ca 100755 --- a/script/bootstrap +++ b/script/bootstrap @@ -15,13 +15,15 @@ DOWNLOAD_DIR = os.path.join(VENDOR_DIR, 'download') def main(): args = parse_args() return (update_submodules() or - download_libchromiumcontent(args.commit, args.url)) + download_libchromiumcontent(args.dev, args.commit, args.url)) def parse_args(): parser = argparse.ArgumentParser(description='Bootstrap this project') parser.add_argument('-c', '--commit', nargs='?', default='HEAD', help='The commit of libchromiumcontent to download.') + parser.add_argument('-d', '--dev', action='store_true', + help='Do not download static_library build') parser.add_argument('url', help='The base URL from which to download ' 'libchromiumcontent (i.e., the URL you passed to ' 'libchromiumcontent\'s script/upload script') @@ -35,12 +37,16 @@ def update_submodules(): '--recursive'])) -def download_libchromiumcontent(commit, url): +def download_libchromiumcontent(is_dev, commit, url): mkdir_p(DOWNLOAD_DIR) download = os.path.join(VENDOR_DIR, 'libchromiumcontent', 'script', 'download') - return subprocess.call([sys.executable, download, '-f', '-c', commit, url, - os.path.join(DOWNLOAD_DIR, 'libchromiumcontent')]) + target = os.path.join(DOWNLOAD_DIR, 'libchromiumcontent') + subprocess.check_call([sys.executable, download, '-f', '-c', commit, url, + target]) + if not is_dev: + subprocess.check_call([sys.executable, download, '-s', '-f', '-c', commit, + url, target]) def mkdir_p(path): diff --git a/vendor/libchromiumcontent b/vendor/libchromiumcontent index 846a13a..1b7aec0 160000 --- a/vendor/libchromiumcontent +++ b/vendor/libchromiumcontent @@ -1 +1 @@ -Subproject commit 846a13ae2234490d78568a68f07f5be95c24c0c3 +Subproject commit 1b7aec028cf86463bc6c00ce15e294cdd157b5c1 From 3199b1b6dd94b0727dece34345d698952f503f33 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Sun, 5 Apr 2015 22:51:38 +0800 Subject: [PATCH 09/45] win: Fix libchromiumcontent_src_dir not defined --- brightray.gypi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/brightray.gypi b/brightray.gypi index 43a1779..48b0fe9 100644 --- a/brightray.gypi +++ b/brightray.gypi @@ -3,7 +3,7 @@ 'vendor/download/libchromiumcontent/filenames.gypi', ], 'variables': { - 'libchromiumcontent_src_dir%': '<(libchromiumcontent_root_dir)/src', + 'libchromiumcontent_src_dir': '<(libchromiumcontent_root_dir)/src', 'libchromiumcontent_component%': 1, 'conditions': [ # The "libchromiumcontent_component" is defined when calling "gyp". From 7b4c9c34318ac19cbadbafc6b5f0a57374cc5189 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Sun, 5 Apr 2015 23:03:34 +0800 Subject: [PATCH 10/45] win: Add configurations for x64 build --- brightray.gypi | 179 ++++++++++++++++++++++++++++--------------------- 1 file changed, 102 insertions(+), 77 deletions(-) diff --git a/brightray.gypi b/brightray.gypi index 48b0fe9..70a9f58 100644 --- a/brightray.gypi +++ b/brightray.gypi @@ -113,90 +113,115 @@ ], }], ], - }, - 'conditions': [ - ['libchromiumcontent_component', { - 'D': { - 'inherit_from': [ - 'Common_Base', + }, # Common_Base + 'Debug_Base': { + 'msvs_settings': { + 'VCCLCompilerTool': { + 'Optimization': '<(win_debug_Optimization)', + 'BasicRuntimeChecks': '<(win_debug_RuntimeChecks)', + # We use Release to match the version of chromiumcontent.dll we + # link against. + 'RuntimeLibrary': '<(win_release_RuntimeLibrary)', + 'conditions': [ + # According to MSVS, InlineFunctionExpansion=0 means + # "default inlining", not "/Ob0". + # Thus, we have to handle InlineFunctionExpansion==0 separately. + ['win_debug_InlineFunctionExpansion==0', { + 'AdditionalOptions': ['/Ob0'], + }], + ['win_debug_InlineFunctionExpansion!=""', { + 'InlineFunctionExpansion': + '<(win_debug_InlineFunctionExpansion)', + }], + # if win_debug_OmitFramePointers is blank, leave as default + ['win_debug_OmitFramePointers==1', { + 'OmitFramePointers': 'true', + }], + ['win_debug_OmitFramePointers==0', { + 'OmitFramePointers': 'false', + # The above is not sufficient (http://crbug.com/106711): it + # simply eliminates an explicit "/Oy", but both /O2 and /Ox + # perform FPO regardless, so we must explicitly disable. + # We still want the false setting above to avoid having + # "/Oy /Oy-" and warnings about overriding. + 'AdditionalOptions': ['/Oy-'], + }], ], - 'msvs_settings': { - 'VCCLCompilerTool': { - 'Optimization': '<(win_debug_Optimization)', - 'BasicRuntimeChecks': '<(win_debug_RuntimeChecks)', - # We use Release to match the version of chromiumcontent.dll we - # link against. - 'RuntimeLibrary': '<(win_release_RuntimeLibrary)', - 'conditions': [ - # According to MSVS, InlineFunctionExpansion=0 means - # "default inlining", not "/Ob0". - # Thus, we have to handle InlineFunctionExpansion==0 separately. - ['win_debug_InlineFunctionExpansion==0', { - 'AdditionalOptions': ['/Ob0'], - }], - ['win_debug_InlineFunctionExpansion!=""', { - 'InlineFunctionExpansion': - '<(win_debug_InlineFunctionExpansion)', - }], - # if win_debug_OmitFramePointers is blank, leave as default - ['win_debug_OmitFramePointers==1', { - 'OmitFramePointers': 'true', - }], - ['win_debug_OmitFramePointers==0', { - 'OmitFramePointers': 'false', - # The above is not sufficient (http://crbug.com/106711): it - # simply eliminates an explicit "/Oy", but both /O2 and /Ox - # perform FPO regardless, so we must explicitly disable. - # We still want the false setting above to avoid having - # "/Oy /Oy-" and warnings about overriding. - 'AdditionalOptions': ['/Oy-'], - }], - ], - }, - }, - 'xcode_settings': { - 'COPY_PHASE_STRIP': 'NO', - 'GCC_OPTIMIZATION_LEVEL': '0', - }, }, - }, { - 'R': { - 'inherit_from': [ - 'Common_Base', + }, + 'xcode_settings': { + 'COPY_PHASE_STRIP': 'NO', + 'GCC_OPTIMIZATION_LEVEL': '0', + }, + }, # Debug_Base + 'Release_Base': { + 'msvs_settings': { + 'VCCLCompilerTool': { + 'Optimization': '<(win_release_Optimization)', + 'RuntimeLibrary': '<(win_release_RuntimeLibrary)', + 'conditions': [ + # According to MSVS, InlineFunctionExpansion=0 means + # "default inlining", not "/Ob0". + # Thus, we have to handle InlineFunctionExpansion==0 separately. + ['win_release_InlineFunctionExpansion==0', { + 'AdditionalOptions': ['/Ob0'], + }], + ['win_release_InlineFunctionExpansion!=""', { + 'InlineFunctionExpansion': + '<(win_release_InlineFunctionExpansion)', + }], + # if win_release_OmitFramePointers is blank, leave as default + ['win_release_OmitFramePointers==1', { + 'OmitFramePointers': 'true', + }], + ['win_release_OmitFramePointers==0', { + 'OmitFramePointers': 'false', + # The above is not sufficient (http://crbug.com/106711): it + # simply eliminates an explicit "/Oy", but both /O2 and /Ox + # perform FPO regardless, so we must explicitly disable. + # We still want the false setting above to avoid having + # "/Oy /Oy-" and warnings about overriding. + 'AdditionalOptions': ['/Oy-'], + }], ], + }, + }, + }, # Release_Base + 'conditions': [ + ['OS=="win"', { + 'x64_Base': { + 'abstract': 1, + 'msvs_configuration_platform': 'x64', 'msvs_settings': { - 'VCCLCompilerTool': { - 'Optimization': '<(win_release_Optimization)', - 'RuntimeLibrary': '<(win_release_RuntimeLibrary)', - 'conditions': [ - # According to MSVS, InlineFunctionExpansion=0 means - # "default inlining", not "/Ob0". - # Thus, we have to handle InlineFunctionExpansion==0 separately. - ['win_release_InlineFunctionExpansion==0', { - 'AdditionalOptions': ['/Ob0'], - }], - ['win_release_InlineFunctionExpansion!=""', { - 'InlineFunctionExpansion': - '<(win_release_InlineFunctionExpansion)', - }], - # if win_release_OmitFramePointers is blank, leave as default - ['win_release_OmitFramePointers==1', { - 'OmitFramePointers': 'true', - }], - ['win_release_OmitFramePointers==0', { - 'OmitFramePointers': 'false', - # The above is not sufficient (http://crbug.com/106711): it - # simply eliminates an explicit "/Oy", but both /O2 and /Ox - # perform FPO regardless, so we must explicitly disable. - # We still want the false setting above to avoid having - # "/Oy /Oy-" and warnings about overriding. - 'AdditionalOptions': ['/Oy-'], - }], - ], + 'VCLinkerTool': { + # Make sure to understand http://crbug.com/361720 if you want to + # increase this. + 'MinimumRequiredVersion': '5.02', # Server 2003. + 'TargetMachine': '17', # x86 - 64 + # Doesn't exist x64 SDK. Should use oleaut32 in any case. + 'IgnoreDefaultLibraryNames': [ 'olepro32.lib' ], + }, + 'VCLibrarianTool': { + 'TargetMachine': '17', # x64 }, }, }, - }], + }], # OS=="win" + ['libchromiumcontent_component', { + 'D': { + 'inherit_from': ['Common_Base', 'Debug_Base'], + }, + 'D_x64': { + 'inherit_from': ['Common_Base', 'x64_Base', 'Debug_Base'], + }, + }, { # libchromiumcontent_component==1 + 'R': { + 'inherit_from': ['Common_Base', 'Release_Base'], + }, + 'R_x64': { + 'inherit_from': ['Common_Base', 'x64_Base', 'Release_Base'], + }, + }], # libchromiumcontent_component==0 ], }, 'conditions': [ From 0890dc3b2a5e20fca767d6c616557a73b271b501 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Mon, 6 Apr 2015 12:03:22 +0800 Subject: [PATCH 11/45] win: Link with sandbox and base_static under component build --- brightray.gyp | 12 +++++------- vendor/libchromiumcontent | 2 +- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/brightray.gyp b/brightray.gyp index 01ba60a..b8b2178 100644 --- a/brightray.gyp +++ b/brightray.gyp @@ -116,15 +116,15 @@ 'link_settings': { 'libraries': [ '$(SDKROOT)/System/Library/Frameworks/AppKit.framework', + # This library is built as shared library to avoid symbols + # conflict with Node. + '<(libchromiumcontent_dir)/libboringssl.dylib', ], }, }], ['OS=="mac" and libchromiumcontent_component==0', { 'link_settings': { 'libraries': [ - # This library is built as shared library to avoid symbols - # conflict with Node. - '<(libchromiumcontent_dir)/libboringssl.dylib', # ui_base.gypi: '$(SDKROOT)/System/Library/Frameworks/Accelerate.framework', # net.gypi: @@ -154,13 +154,11 @@ ], }, }], - ['OS=="win"', { + ['OS=="win" and libchromiumcontent_component', { 'link_settings': { 'libraries': [ '<(libchromiumcontent_dir)/base_static.lib', - '<(libchromiumcontent_dir)/chromiumcontent.dll.lib', - '<(libchromiumcontent_dir)/chromiumviews.lib', - '<(libchromiumcontent_dir)/sandbox_static.lib', + '<(libchromiumcontent_dir)/sandbox.lib', ], }, }], diff --git a/vendor/libchromiumcontent b/vendor/libchromiumcontent index 1b7aec0..fa70c1a 160000 --- a/vendor/libchromiumcontent +++ b/vendor/libchromiumcontent @@ -1 +1 @@ -Subproject commit 1b7aec028cf86463bc6c00ce15e294cdd157b5c1 +Subproject commit fa70c1a296d9b8f89a4e42bd3116ac36a831169c From cd70f45a19dcb73b15d9e9567ee082330a168a85 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Mon, 6 Apr 2015 14:19:28 +0800 Subject: [PATCH 12/45] win: Fix defines under component build --- brightray.gypi | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/brightray.gypi b/brightray.gypi index 70a9f58..a82345d 100644 --- a/brightray.gypi +++ b/brightray.gypi @@ -103,8 +103,6 @@ 'defines': [ 'TOOLKIT_VIEWS', 'USE_AURA', - 'VIEWS_IMPLEMENTATION', - 'WEBVIEW_IMPLEMENTATION', ], }], ['OS not in ["mac", "win"]', { @@ -259,13 +257,15 @@ }, 'conditions': [ ['libchromiumcontent_component', { - 'defines': [ - 'COMPONENT_BUILD', - 'GURL_DLL', - 'SKIA_DLL', - 'USING_V8_SHARED', - 'WEBKIT_DLL', - ], + 'target_defaults': { + 'defines': [ + 'COMPONENT_BUILD', + 'GURL_DLL', + 'SKIA_DLL', + 'USING_V8_SHARED', + 'WEBKIT_DLL', + ], + }, }], ['OS=="linux" and linux_clang==1', { 'make_global_settings': [ From 525641300bcbb20a43f9bf08f6dd957d7a28d888 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Mon, 6 Apr 2015 15:03:53 +0800 Subject: [PATCH 13/45] win: Fix linking with ffmepg --- brightray.gyp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/brightray.gyp b/brightray.gyp index b8b2178..c522fb7 100644 --- a/brightray.gyp +++ b/brightray.gyp @@ -161,6 +161,19 @@ '<(libchromiumcontent_dir)/sandbox.lib', ], }, + }, { + 'link_settings': { + 'libraries': [ + '<(libchromiumcontent_dir)/ffmpegsumo.lib', + ], + 'msvs_settings': { + 'VCLinkerTool': { + 'DelayLoadDLLs': [ + 'ffmpegsumo.dll', + ], + }, + }, + }, }], ], }, From 7feb0f961a7ada609c2fb3b4538ff880f0677d93 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Mon, 6 Apr 2015 15:04:07 +0800 Subject: [PATCH 14/45] win: Fix linking with libyuv --- brightray.gyp | 1 + brightray.gypi | 2 ++ vendor/libchromiumcontent | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/brightray.gyp b/brightray.gyp index c522fb7..1f2da5c 100644 --- a/brightray.gyp +++ b/brightray.gyp @@ -165,6 +165,7 @@ 'link_settings': { 'libraries': [ '<(libchromiumcontent_dir)/ffmpegsumo.lib', + '<(libchromiumcontent_dir)/libyuv.lib', ], 'msvs_settings': { 'VCLinkerTool': { diff --git a/brightray.gypi b/brightray.gypi index a82345d..2f74e91 100644 --- a/brightray.gypi +++ b/brightray.gypi @@ -91,10 +91,12 @@ 'VCLinkerTool': { 'AdditionalDependencies': [ 'advapi32.lib', + 'dbghelp.lib', 'dwmapi.lib', 'gdi32.lib', 'oleacc.lib', 'user32.lib', + 'winspool.lib', ], }, }, diff --git a/vendor/libchromiumcontent b/vendor/libchromiumcontent index fa70c1a..424b9b8 160000 --- a/vendor/libchromiumcontent +++ b/vendor/libchromiumcontent @@ -1 +1 @@ -Subproject commit fa70c1a296d9b8f89a4e42bd3116ac36a831169c +Subproject commit 424b9b8437a6d3233d35c5754d78716f7f5e2a71 From cbd55d9316cab0d642a18602b7c6f177e37dadab Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Mon, 6 Apr 2015 15:14:57 +0800 Subject: [PATCH 15/45] win: Link with boringssl.dll --- brightray.gyp | 1 + vendor/libchromiumcontent | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/brightray.gyp b/brightray.gyp index 1f2da5c..30b3db5 100644 --- a/brightray.gyp +++ b/brightray.gyp @@ -164,6 +164,7 @@ }, { 'link_settings': { 'libraries': [ + '<(libchromiumcontent_dir)/boringssl.dll', '<(libchromiumcontent_dir)/ffmpegsumo.lib', '<(libchromiumcontent_dir)/libyuv.lib', ], diff --git a/vendor/libchromiumcontent b/vendor/libchromiumcontent index 424b9b8..301d2d6 160000 --- a/vendor/libchromiumcontent +++ b/vendor/libchromiumcontent @@ -1 +1 @@ -Subproject commit 424b9b8437a6d3233d35c5754d78716f7f5e2a71 +Subproject commit 301d2d617c64ed020bf787d541b9a7d5e10941a8 From f58bc1bfbad346690eedf322b804d7954b1a2662 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Mon, 6 Apr 2015 15:20:27 +0800 Subject: [PATCH 16/45] win: Import system libraries in content_common.gypi --- brightray.gyp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/brightray.gyp b/brightray.gyp index 30b3db5..925bf0f 100644 --- a/brightray.gyp +++ b/brightray.gyp @@ -167,11 +167,24 @@ '<(libchromiumcontent_dir)/boringssl.dll', '<(libchromiumcontent_dir)/ffmpegsumo.lib', '<(libchromiumcontent_dir)/libyuv.lib', + # content_common.gypi: + '-ld3d11.lib', + '-ldxva2.lib', + '-lstrmiids.lib', + '-lmf.lib', + '-lmfplat.lib', + '-lmfuuid.lib', ], 'msvs_settings': { 'VCLinkerTool': { 'DelayLoadDLLs': [ 'ffmpegsumo.dll', + # content_common.gypi: + 'd3d9.dll', + 'd3d11.dll', + 'dxva2.dll', + 'mf.dll', + 'mfplat.dll', ], }, }, From a09b6c78b76fbbc019a9be72a0c5f2403f5c0763 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Mon, 6 Apr 2015 16:01:31 +0800 Subject: [PATCH 17/45] win: Link with libraries from other places --- brightray.gyp | 8 ++++++-- brightray.gypi | 11 ++++------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/brightray.gyp b/brightray.gyp index 925bf0f..41db0f5 100644 --- a/brightray.gyp +++ b/brightray.gyp @@ -167,13 +167,18 @@ '<(libchromiumcontent_dir)/boringssl.dll', '<(libchromiumcontent_dir)/ffmpegsumo.lib', '<(libchromiumcontent_dir)/libyuv.lib', + # content_browser.gypi: + '-lsensorsapi.lib', + '-lportabledeviceguids.lib', # content_common.gypi: - '-ld3d11.lib', + '-ld3d9.lib', '-ldxva2.lib', '-lstrmiids.lib', '-lmf.lib', '-lmfplat.lib', '-lmfuuid.lib', + # media.gyp: + '-lmfreadwrite.lib', ], 'msvs_settings': { 'VCLinkerTool': { @@ -181,7 +186,6 @@ 'ffmpegsumo.dll', # content_common.gypi: 'd3d9.dll', - 'd3d11.dll', 'dxva2.dll', 'mf.dll', 'mfplat.dll', diff --git a/brightray.gypi b/brightray.gypi index 2f74e91..7d03a5e 100644 --- a/brightray.gypi +++ b/brightray.gypi @@ -22,9 +22,6 @@ # Build with clang under Linux. 'linux_clang%': 1, - 'win_release_RuntimeLibrary%': '2', # /MD (nondebug DLL) - 'win_debug_RuntimeLibrary%': '3', # /MTd (debug DLL) - # See http://msdn.microsoft.com/en-us/library/aa652360(VS.71).aspx 'win_release_Optimization%': '2', # 2 = /Os 'win_debug_Optimization%': '0', # 0 = /Od @@ -94,8 +91,12 @@ 'dbghelp.lib', 'dwmapi.lib', 'gdi32.lib', + 'netapi32.lib', 'oleacc.lib', + 'powrprof.lib', 'user32.lib', + 'usp10.lib', + 'version.lib', 'winspool.lib', ], }, @@ -119,9 +120,6 @@ 'VCCLCompilerTool': { 'Optimization': '<(win_debug_Optimization)', 'BasicRuntimeChecks': '<(win_debug_RuntimeChecks)', - # We use Release to match the version of chromiumcontent.dll we - # link against. - 'RuntimeLibrary': '<(win_release_RuntimeLibrary)', 'conditions': [ # According to MSVS, InlineFunctionExpansion=0 means # "default inlining", not "/Ob0". @@ -158,7 +156,6 @@ 'msvs_settings': { 'VCCLCompilerTool': { 'Optimization': '<(win_release_Optimization)', - 'RuntimeLibrary': '<(win_release_RuntimeLibrary)', 'conditions': [ # According to MSVS, InlineFunctionExpansion=0 means # "default inlining", not "/Ob0". From f2269aaf5517e2c35cb314dd6af6764c6e280b25 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Mon, 6 Apr 2015 21:41:36 +0800 Subject: [PATCH 18/45] Fix generating configs on OS X and Linux --- brightray.gypi | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/brightray.gypi b/brightray.gypi index 7d03a5e..7d38af3 100644 --- a/brightray.gypi +++ b/brightray.gypi @@ -185,6 +185,15 @@ }, }, # Release_Base 'conditions': [ + ['libchromiumcontent_component', { + 'D': { + 'inherit_from': ['Common_Base', 'Debug_Base'], + }, # D (Debug) + }, { + 'R': { + 'inherit_from': ['Common_Base', 'Release_Base'], + }, # R (Release) + }], # libchromiumcontent_component ['OS=="win"', { 'x64_Base': { 'abstract': 1, @@ -202,23 +211,18 @@ 'TargetMachine': '17', # x64 }, }, - }, + }, # x64_Base }], # OS=="win" - ['libchromiumcontent_component', { - 'D': { - 'inherit_from': ['Common_Base', 'Debug_Base'], - }, + ['OS=="win" and libchromiumcontent_component==1', { 'D_x64': { 'inherit_from': ['Common_Base', 'x64_Base', 'Debug_Base'], - }, - }, { # libchromiumcontent_component==1 - 'R': { - 'inherit_from': ['Common_Base', 'Release_Base'], - }, + }, # D_x64 + }], # OS=="win" and libchromiumcontent_component==1 + ['OS=="win" and libchromiumcontent_component==0', { 'R_x64': { 'inherit_from': ['Common_Base', 'x64_Base', 'Release_Base'], - }, - }], # libchromiumcontent_component==0 + }, # R_x64 + }], # OS=="win" and libchromiumcontent_component==0 ], }, 'conditions': [ From d4c8ac2565a2e257c37215d9b65d6dd0267aad1b Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Tue, 7 Apr 2015 11:28:56 +0800 Subject: [PATCH 19/45] mac: Fix linking with boringssl --- brightray.gyp | 9 +++------ vendor/libchromiumcontent | 2 +- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/brightray.gyp b/brightray.gyp index 41db0f5..0d0b330 100644 --- a/brightray.gyp +++ b/brightray.gyp @@ -116,9 +116,6 @@ 'link_settings': { 'libraries': [ '$(SDKROOT)/System/Library/Frameworks/AppKit.framework', - # This library is built as shared library to avoid symbols - # conflict with Node. - '<(libchromiumcontent_dir)/libboringssl.dylib', ], }, }], @@ -154,17 +151,17 @@ ], }, }], - ['OS=="win" and libchromiumcontent_component', { + ['OS=="win" and libchromiumcontent_component==1', { 'link_settings': { 'libraries': [ '<(libchromiumcontent_dir)/base_static.lib', '<(libchromiumcontent_dir)/sandbox.lib', ], }, - }, { + }], + ['OS=="win" and libchromiumcontent_component==0', { 'link_settings': { 'libraries': [ - '<(libchromiumcontent_dir)/boringssl.dll', '<(libchromiumcontent_dir)/ffmpegsumo.lib', '<(libchromiumcontent_dir)/libyuv.lib', # content_browser.gypi: diff --git a/vendor/libchromiumcontent b/vendor/libchromiumcontent index 301d2d6..b371f0a 160000 --- a/vendor/libchromiumcontent +++ b/vendor/libchromiumcontent @@ -1 +1 @@ -Subproject commit 301d2d617c64ed020bf787d541b9a7d5e10941a8 +Subproject commit b371f0a7b0c1dd47d68f6ea5bade36451a13e7e1 From 71a4624adf2e95ee57138d6f5f1b5c469c20c4b4 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Tue, 7 Apr 2015 13:48:09 +0800 Subject: [PATCH 20/45] win: Link with DLL version of vcrt in component build --- brightray.gypi | 1 + 1 file changed, 1 insertion(+) diff --git a/brightray.gypi b/brightray.gypi index 7d38af3..8d77b60 100644 --- a/brightray.gypi +++ b/brightray.gypi @@ -118,6 +118,7 @@ 'Debug_Base': { 'msvs_settings': { 'VCCLCompilerTool': { + 'RuntimeLibrary': '2', # /MD (nondebug DLL) 'Optimization': '<(win_debug_Optimization)', 'BasicRuntimeChecks': '<(win_debug_RuntimeChecks)', 'conditions': [ From ae360b94fff5a25222b3a535aad8bb4e7cd3b992 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Tue, 7 Apr 2015 16:28:38 +0800 Subject: [PATCH 21/45] Still link with shared_library of boringssl --- brightray.gyp | 4 ++++ vendor/libchromiumcontent | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/brightray.gyp b/brightray.gyp index 0d0b330..9eded99 100644 --- a/brightray.gyp +++ b/brightray.gyp @@ -122,6 +122,9 @@ ['OS=="mac" and libchromiumcontent_component==0', { 'link_settings': { 'libraries': [ + # This library is built as shared library to avoid symbols + # conflict with Node. + '<(libchromiumcontent_dir)/libboringssl.dylib', # ui_base.gypi: '$(SDKROOT)/System/Library/Frameworks/Accelerate.framework', # net.gypi: @@ -162,6 +165,7 @@ ['OS=="win" and libchromiumcontent_component==0', { 'link_settings': { 'libraries': [ + '<(libchromiumcontent_dir)/boringssl.lib', '<(libchromiumcontent_dir)/ffmpegsumo.lib', '<(libchromiumcontent_dir)/libyuv.lib', # content_browser.gypi: diff --git a/vendor/libchromiumcontent b/vendor/libchromiumcontent index b371f0a..97917e7 160000 --- a/vendor/libchromiumcontent +++ b/vendor/libchromiumcontent @@ -1 +1 @@ -Subproject commit b371f0a7b0c1dd47d68f6ea5bade36451a13e7e1 +Subproject commit 97917e790421e8617ce685a1e32cf98a64052f7a From 616ce9051fef9896651686aa9a0b6403caa4e1a8 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Tue, 7 Apr 2015 20:18:09 +0800 Subject: [PATCH 22/45] Fix path to boringssl.dll --- brightray.gyp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/brightray.gyp b/brightray.gyp index 9eded99..00ef172 100644 --- a/brightray.gyp +++ b/brightray.gyp @@ -165,7 +165,7 @@ ['OS=="win" and libchromiumcontent_component==0', { 'link_settings': { 'libraries': [ - '<(libchromiumcontent_dir)/boringssl.lib', + '<(libchromiumcontent_dir)/boringssl.dll', '<(libchromiumcontent_dir)/ffmpegsumo.lib', '<(libchromiumcontent_dir)/libyuv.lib', # content_browser.gypi: From e1304edb03ac774d1386be19bcced0822aabbc70 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Tue, 7 Apr 2015 23:39:08 +0800 Subject: [PATCH 23/45] Don't call download twice --- script/bootstrap | 8 ++++---- vendor/libchromiumcontent | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/script/bootstrap b/script/bootstrap index 23b33ca..b0754f7 100755 --- a/script/bootstrap +++ b/script/bootstrap @@ -31,7 +31,6 @@ def parse_args(): def update_submodules(): - return return (subprocess.call(['git', 'submodule', 'sync', '--quiet']) or subprocess.call(['git', 'submodule', 'update', '--init', '--recursive'])) @@ -42,9 +41,10 @@ def download_libchromiumcontent(is_dev, commit, url): download = os.path.join(VENDOR_DIR, 'libchromiumcontent', 'script', 'download') target = os.path.join(DOWNLOAD_DIR, 'libchromiumcontent') - subprocess.check_call([sys.executable, download, '-f', '-c', commit, url, - target]) - if not is_dev: + if is_dev: + subprocess.check_call([sys.executable, download, '-f', '-c', commit, url, + target]) + else: subprocess.check_call([sys.executable, download, '-s', '-f', '-c', commit, url, target]) diff --git a/vendor/libchromiumcontent b/vendor/libchromiumcontent index 97917e7..d4f20e2 160000 --- a/vendor/libchromiumcontent +++ b/vendor/libchromiumcontent @@ -1 +1 @@ -Subproject commit 97917e790421e8617ce685a1e32cf98a64052f7a +Subproject commit d4f20e2775350ec53506aba4244115dc5ca6d7b8 From a44b1be3f38d60265165829e80f52ec95fc14e5d Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Wed, 8 Apr 2015 02:34:58 +0000 Subject: [PATCH 24/45] linux: Link with libboringssl.so --- brightray.gyp | 4 +++- vendor/libchromiumcontent | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/brightray.gyp b/brightray.gyp index 00ef172..3b989ac 100644 --- a/brightray.gyp +++ b/brightray.gyp @@ -106,12 +106,14 @@ ' Date: Wed, 8 Apr 2015 04:08:21 +0000 Subject: [PATCH 25/45] Link with static_library version of libgtk2ui --- brightray.gyp | 18 +++++++++++++++--- vendor/libchromiumcontent | 2 +- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/brightray.gyp b/brightray.gyp index 3b989ac..d5316e0 100644 --- a/brightray.gyp +++ b/brightray.gyp @@ -110,9 +110,21 @@ ' Date: Wed, 8 Apr 2015 08:22:55 +0000 Subject: [PATCH 26/45] linux: Fix linking with system libraries --- brightray.gyp | 29 ++++++++++++++++++++++++++--- vendor/libchromiumcontent | 2 +- 2 files changed, 27 insertions(+), 4 deletions(-) diff --git a/brightray.gyp b/brightray.gyp index d5316e0..83b325d 100644 --- a/brightray.gyp +++ b/brightray.gyp @@ -92,10 +92,23 @@ 'common/main_delegate.h', 'common/main_delegate_mac.mm', ], - 'link_settings': { - 'libraries': [ '<@(libchromiumcontent_libraries)' ] - }, 'conditions': [ + ['OS=="linux" and libchromiumcontent_component==0', { + # On Linux we have to use "--whole-archive" to force executable + # to include all symbols, otherwise we will have plenty of + # unresolved symbols errors. + 'direct_dependent_settings': { + 'ldflags': [ + '-Wl,--whole-archive', + '<@(libchromiumcontent_libraries)', + '-Wl,--no-whole-archive', + ], + } + }, { + 'link_settings': { + 'libraries': [ '<@(libchromiumcontent_libraries)' ] + }, + }], ['OS=="linux"', { 'cflags_cc': [ '-Wno-deprecated-register', @@ -121,6 +134,16 @@ 'link_settings': { 'libraries': [ '<(libchromiumcontent_dir)/libboringssl.so', + '-lasound', + '-lcap', + '-lcups', + '-lrt', + '-ldl', + '-lresolv', + '-lfontconfig', + '-lfreetype', + '-lX11 -lXi -lXcursor -lXext -lXfixes -lXrender -lXcomposite -lXdamage -lXtst -lXrandr', + '-lexpat', ], }, }], diff --git a/vendor/libchromiumcontent b/vendor/libchromiumcontent index c94e623..09c2eb3 160000 --- a/vendor/libchromiumcontent +++ b/vendor/libchromiumcontent @@ -1 +1 @@ -Subproject commit c94e623f5951db672958f10b098808fc2017ea40 +Subproject commit 09c2eb301ceb50f1ae01f9ba7af4a2adf77a4d87 From dfce146b6249c191fe7cba624ce85432d3894d1d Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Wed, 8 Apr 2015 19:20:51 +0800 Subject: [PATCH 27/45] Remove linux_clang option --- brightray.gypi | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/brightray.gypi b/brightray.gypi index 8d77b60..e0336b0 100644 --- a/brightray.gypi +++ b/brightray.gypi @@ -19,9 +19,6 @@ 'mac_deployment_target%': '10.8', 'mac_sdkroot%': 'macosx', - # Build with clang under Linux. - 'linux_clang%': 1, - # See http://msdn.microsoft.com/en-us/library/aa652360(VS.71).aspx 'win_release_Optimization%': '2', # 2 = /Os 'win_debug_Optimization%': '0', # 0 = /Od @@ -271,16 +268,6 @@ ], }, }], - ['OS=="linux" and linux_clang==1', { - 'make_global_settings': [ - ['CC', '/usr/bin/clang'], - ['CXX', '/usr/bin/clang++'], - ['LINK', '$(CXX)'], - ['CC.host', '$(CC)'], - ['CXX.host', '$(CXX)'], - ['LINK.host', '$(LINK)'], - ], - }], ['OS=="win"', { 'target_defaults': { 'include_dirs': [ From 821eed6ada17149eea96bb3ab6cb0c299342f535 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Thu, 9 Apr 2015 09:58:07 +0800 Subject: [PATCH 28/45] linux: Improve building flags for Release build --- brightray.gyp | 26 +++++++++++++++++----- brightray.gypi | 59 ++++++++++++++++++++++++++++++++++---------------- 2 files changed, 60 insertions(+), 25 deletions(-) diff --git a/brightray.gyp b/brightray.gyp index 83b325d..1a59098 100644 --- a/brightray.gyp +++ b/brightray.gyp @@ -93,6 +93,7 @@ 'common/main_delegate_mac.mm', ], 'conditions': [ + # Link with libraries of libchromiumcontent. ['OS=="linux" and libchromiumcontent_component==0', { # On Linux we have to use "--whole-archive" to force executable # to include all symbols, otherwise we will have plenty of @@ -110,30 +111,43 @@ }, }], ['OS=="linux"', { - 'cflags_cc': [ - '-Wno-deprecated-register', - '-fno-rtti', - ], + 'variables': { + 'system_libraries': 'gtk+-2.0 libnotify dbus-1 x11 xrandr xext gconf-2.0', + }, 'link_settings': { 'ldflags': [ - ' Date: Thu, 9 Apr 2015 10:03:01 +0800 Subject: [PATCH 29/45] Move filename rules to another file --- brightray.gypi | 29 +++-------------- filename_rules.gypi | 77 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 81 insertions(+), 25 deletions(-) create mode 100644 filename_rules.gypi diff --git a/brightray.gypi b/brightray.gypi index c8d9d7f..c41b7c5 100644 --- a/brightray.gypi +++ b/brightray.gypi @@ -37,6 +37,10 @@ 'win_release_InlineFunctionExpansion%': '2', # 1 = only __inline, 2 = max }, 'target_defaults': { + 'includes': [ + # Rules for excluding e.g. foo_win.cc from the build on non-Windows. + 'filename_rules.gypi', + ], 'xcode_settings': { 'ALWAYS_SEARCH_USER_PATHS': 'NO', 'ARCHS': ['x86_64'], @@ -262,31 +266,6 @@ }], # OS=="win" and libchromiumcontent_component==0 ], }, - 'conditions': [ - ['OS!="mac"', { - 'sources/': [ - ['exclude', '/mac/'], - ['exclude', '_mac\.(mm|h)$'], - ], - }, { - 'sources/': [ - ['exclude', '/views/'], - ['exclude', '_views\.(cc|h)$'], - ], - }], - ['OS!="win"', { - 'sources/': [ - ['exclude', '/win/'], - ['exclude', '_win\.(cc|h)$'], - ], - }], - ['OS!="linux"', { - 'sources/': [ - ['exclude', '/linux/'], - ['exclude', '_linux\.(cc|h)$'], - ], - }], - ], }, 'conditions': [ ['OS=="win"', { diff --git a/filename_rules.gypi b/filename_rules.gypi new file mode 100644 index 0000000..e1ee46d --- /dev/null +++ b/filename_rules.gypi @@ -0,0 +1,77 @@ +# Copyright (c) 2012 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# This gypi file defines the patterns used for determining whether a +# file is excluded from the build on a given platform. It is +# included by common.gypi for chromium_code. + +{ + 'target_conditions': [ + ['OS!="win"', { + 'sources/': [ ['exclude', '_win(_unittest)?\\.(h|cc)$'], + ['exclude', '(^|/)win/'], + ['exclude', '(^|/)win_[^/]*\\.(h|cc)$'] ], + }], + ['OS!="mac"', { + 'sources/': [ ['exclude', '_(cocoa|mac)(_unittest)?\\.(h|cc|mm?)$'], + ['exclude', '(^|/)(cocoa|mac)/'] ], + }], + ['OS!="ios"', { + 'sources/': [ ['exclude', '_ios(_unittest)?\\.(h|cc|mm?)$'], + ['exclude', '(^|/)ios/'] ], + }], + ['OS!="mac" and OS!="ios"', { + 'sources/': [ ['exclude', '\\.mm?$' ] ], + }], + # Do not exclude the linux files on *BSD since most of them can be + # shared at this point. + # In case a file is not needed, it is going to be excluded later on. + # TODO(evan): the above is not correct; we shouldn't build _linux + # files on non-linux. + ['OS!="linux" and OS!="openbsd" and OS!="freebsd"', { + 'sources/': [ + ['exclude', '(^|/)library_loaders/'], + ['exclude', '_linux(_unittest)?\\.(h|cc)$'], + ['exclude', '(^|/)linux_[^/]*\\.(h|cc)$'], + ['exclude', '(^|/)linux/'], + ['exclude', '_x11(_unittest)?\\.(h|cc)$'], + ['exclude', '(^|/)x11_[^/]*\\.(h|cc)$'], + ['exclude', '(^|/)x11/'], + ], + }], + ['OS!="android"', { + 'sources/': [ + ['exclude', '_android(_unittest)?\\.cc$'], + ['exclude', '(^|/)android/'], + ], + }], + ['OS=="win"', { + 'sources/': [ + ['exclude', '_posix(_unittest)?\\.(h|cc)$'], + ['exclude', '(^|/)posix/'], + ], + }], + ['OS!="linux" and OS!="openbsd" and OS!="freebsd"', { + 'sources/': [ + ['exclude', '_xdg(_unittest)?\\.(h|cc)$'], + ], + }], + ['OS!="linux" and OS!="openbsd" and OS!="freebsd"', { + 'sources/': [ + ['exclude', '_gtk(_browsertest|_unittest)?\\.(h|cc)$'], + ['exclude', '(^|/)gtk/'], + ['exclude', '(^|/)gtk_[^/]*\\.(h|cc)$'], + ['exclude', '(^|/)libgtk2ui/'], + ['exclude', '(^|/)x/'], + ], + }], + ['OS=="mac"', { + 'sources/': [ ['exclude', '_aura(_browsertest|_unittest)?\\.(h|cc)$'], + ['exclude', '(^|/)aura/'], + ['exclude', '_views\\.(h|cc)$'], + ['exclude', '(^|/)views/'], + ], + }], + ] +} From 1dfc7e599f7f1844435fda03d387e340fb18d331 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Thu, 9 Apr 2015 10:11:28 +0800 Subject: [PATCH 30/45] Move filenames to another file --- brightray.gyp | 69 ++----------------------------------------------- filenames.gypi | 70 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 72 insertions(+), 67 deletions(-) create mode 100644 filenames.gypi diff --git a/brightray.gyp b/brightray.gyp index 1a59098..0497bf6 100644 --- a/brightray.gyp +++ b/brightray.gyp @@ -1,6 +1,6 @@ { 'includes': [ - 'brightray.gypi', + 'filenames.gypi', ], 'targets': [ { @@ -26,72 +26,7 @@ '<(libchromiumcontent_dir)/gen', ], }, - 'sources': [ - 'browser/brightray_paths.h', - 'browser/browser_client.cc', - 'browser/browser_client.h', - 'browser/browser_context.cc', - 'browser/browser_context.h', - 'browser/browser_main_parts.cc', - 'browser/browser_main_parts.h', - 'browser/browser_main_parts_mac.mm', - 'browser/default_web_contents_delegate.cc', - 'browser/default_web_contents_delegate.h', - 'browser/default_web_contents_delegate_mac.mm', - 'browser/devtools_contents_resizing_strategy.cc', - 'browser/devtools_contents_resizing_strategy.h', - 'browser/devtools_embedder_message_dispatcher.cc', - 'browser/devtools_embedder_message_dispatcher.h', - 'browser/devtools_manager_delegate.cc', - 'browser/devtools_manager_delegate.h', - 'browser/devtools_ui.cc', - 'browser/devtools_ui.h', - 'browser/inspectable_web_contents.cc', - 'browser/inspectable_web_contents.h', - 'browser/inspectable_web_contents_delegate.cc', - 'browser/inspectable_web_contents_delegate.h', - 'browser/inspectable_web_contents_impl.cc', - 'browser/inspectable_web_contents_impl.h', - 'browser/inspectable_web_contents_view.h', - 'browser/inspectable_web_contents_view_mac.h', - 'browser/inspectable_web_contents_view_mac.mm', - 'browser/mac/bry_application.h', - 'browser/mac/bry_application.mm', - 'browser/mac/bry_inspectable_web_contents_view.h', - 'browser/mac/bry_inspectable_web_contents_view.mm', - 'browser/media/media_capture_devices_dispatcher.cc', - 'browser/media/media_capture_devices_dispatcher.h', - 'browser/media/media_stream_devices_controller.cc', - 'browser/media/media_stream_devices_controller.h', - 'browser/network_delegate.cc', - 'browser/network_delegate.h', - 'browser/notification_presenter.h', - 'browser/notification_presenter_mac.h', - 'browser/notification_presenter_mac.mm', - 'browser/platform_notification_service_impl.cc', - 'browser/platform_notification_service_impl.h', - 'browser/linux/notification_presenter_linux.h', - 'browser/linux/notification_presenter_linux.cc', - 'browser/url_request_context_getter.cc', - 'browser/url_request_context_getter.h', - 'browser/views/inspectable_web_contents_view_views.h', - 'browser/views/inspectable_web_contents_view_views.cc', - 'browser/views/views_delegate.cc', - 'browser/views/views_delegate.h', - 'browser/web_ui_controller_factory.cc', - 'browser/web_ui_controller_factory.h', - 'common/application_info.h', - 'common/application_info_mac.mm', - 'common/application_info_win.cc', - 'common/content_client.cc', - 'common/content_client.h', - 'common/mac/foundation_util.h', - 'common/mac/main_application_bundle.h', - 'common/mac/main_application_bundle.mm', - 'common/main_delegate.cc', - 'common/main_delegate.h', - 'common/main_delegate_mac.mm', - ], + 'sources': [ '<@(brightray_sources)' ], 'conditions': [ # Link with libraries of libchromiumcontent. ['OS=="linux" and libchromiumcontent_component==0', { diff --git a/filenames.gypi b/filenames.gypi new file mode 100644 index 0000000..203e203 --- /dev/null +++ b/filenames.gypi @@ -0,0 +1,70 @@ +{ + 'variables': { + 'brightray_sources': [ + 'browser/brightray_paths.h', + 'browser/browser_client.cc', + 'browser/browser_client.h', + 'browser/browser_context.cc', + 'browser/browser_context.h', + 'browser/browser_main_parts.cc', + 'browser/browser_main_parts.h', + 'browser/browser_main_parts_mac.mm', + 'browser/default_web_contents_delegate.cc', + 'browser/default_web_contents_delegate.h', + 'browser/default_web_contents_delegate_mac.mm', + 'browser/devtools_contents_resizing_strategy.cc', + 'browser/devtools_contents_resizing_strategy.h', + 'browser/devtools_embedder_message_dispatcher.cc', + 'browser/devtools_embedder_message_dispatcher.h', + 'browser/devtools_manager_delegate.cc', + 'browser/devtools_manager_delegate.h', + 'browser/devtools_ui.cc', + 'browser/devtools_ui.h', + 'browser/inspectable_web_contents.cc', + 'browser/inspectable_web_contents.h', + 'browser/inspectable_web_contents_delegate.cc', + 'browser/inspectable_web_contents_delegate.h', + 'browser/inspectable_web_contents_impl.cc', + 'browser/inspectable_web_contents_impl.h', + 'browser/inspectable_web_contents_view.h', + 'browser/inspectable_web_contents_view_mac.h', + 'browser/inspectable_web_contents_view_mac.mm', + 'browser/mac/bry_application.h', + 'browser/mac/bry_application.mm', + 'browser/mac/bry_inspectable_web_contents_view.h', + 'browser/mac/bry_inspectable_web_contents_view.mm', + 'browser/media/media_capture_devices_dispatcher.cc', + 'browser/media/media_capture_devices_dispatcher.h', + 'browser/media/media_stream_devices_controller.cc', + 'browser/media/media_stream_devices_controller.h', + 'browser/network_delegate.cc', + 'browser/network_delegate.h', + 'browser/notification_presenter.h', + 'browser/notification_presenter_mac.h', + 'browser/notification_presenter_mac.mm', + 'browser/platform_notification_service_impl.cc', + 'browser/platform_notification_service_impl.h', + 'browser/linux/notification_presenter_linux.h', + 'browser/linux/notification_presenter_linux.cc', + 'browser/url_request_context_getter.cc', + 'browser/url_request_context_getter.h', + 'browser/views/inspectable_web_contents_view_views.h', + 'browser/views/inspectable_web_contents_view_views.cc', + 'browser/views/views_delegate.cc', + 'browser/views/views_delegate.h', + 'browser/web_ui_controller_factory.cc', + 'browser/web_ui_controller_factory.h', + 'common/application_info.h', + 'common/application_info_mac.mm', + 'common/application_info_win.cc', + 'common/content_client.cc', + 'common/content_client.h', + 'common/mac/foundation_util.h', + 'common/mac/main_application_bundle.h', + 'common/mac/main_application_bundle.mm', + 'common/main_delegate.cc', + 'common/main_delegate.h', + 'common/main_delegate_mac.mm', + ], + }, +} From 80c8211551c3fe6a51ff0abfe235bd889d06ffd6 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Thu, 9 Apr 2015 10:14:25 +0800 Subject: [PATCH 31/45] Add "linux_system_libraries" variable --- brightray.gyp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/brightray.gyp b/brightray.gyp index 0497bf6..5598d31 100644 --- a/brightray.gyp +++ b/brightray.gyp @@ -1,4 +1,8 @@ { + 'variables': { + # The libraries brightray will be compiled to. + 'linux_system_libraries': 'gtk+-2.0 libnotify dbus-1 x11 xrandr xext gconf-2.0' + }, 'includes': [ 'filenames.gypi', ], @@ -46,26 +50,23 @@ }, }], ['OS=="linux"', { - 'variables': { - 'system_libraries': 'gtk+-2.0 libnotify dbus-1 x11 xrandr xext gconf-2.0', - }, 'link_settings': { 'ldflags': [ - ' Date: Thu, 9 Apr 2015 10:40:49 +0800 Subject: [PATCH 32/45] mac: Improve configs for Release build --- brightray.gypi | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/brightray.gypi b/brightray.gypi index c41b7c5..9f869c3 100644 --- a/brightray.gypi +++ b/brightray.gypi @@ -16,9 +16,6 @@ }], ], - 'mac_deployment_target%': '10.8', - 'mac_sdkroot%': 'macosx', - # See http://msdn.microsoft.com/en-us/library/aa652360(VS.71).aspx 'win_release_Optimization%': '2', # 2 = /Os 'win_debug_Optimization%': '0', # 0 = /Od @@ -41,6 +38,7 @@ # Rules for excluding e.g. foo_win.cc from the build on non-Windows. 'filename_rules.gypi', ], + # Putting this in "configurations" will make overrides not working. 'xcode_settings': { 'ALWAYS_SEARCH_USER_PATHS': 'NO', 'ARCHS': ['x86_64'], @@ -50,9 +48,9 @@ 'GCC_ENABLE_CPP_EXCEPTIONS': 'NO', 'GCC_ENABLE_CPP_RTTI': 'NO', 'GCC_TREAT_WARNINGS_AS_ERRORS': 'YES', - 'MACOSX_DEPLOYMENT_TARGET': '<(mac_deployment_target)', + 'MACOSX_DEPLOYMENT_TARGET': '10.8', 'RUN_CLANG_STATIC_ANALYZER': 'YES', - 'SDKROOT': '<(mac_sdkroot)', + 'SDKROOT': 'macosx', 'USE_HEADER_MAP': 'NO', 'WARNING_CFLAGS': [ '-Wall', @@ -202,6 +200,16 @@ }], ], }, + 'xcode_settings': { + 'DEAD_CODE_STRIPPING': 'YES', # -Wl,-dead_strip + 'GCC_OPTIMIZATION_LEVEL': '2', + 'OTHER_CFLAGS': [ + '-fno-inline', + '-fno-omit-frame-pointer', + '-fno-builtin', + '-fno-optimize-sibling-calls', + ], + }, }, 'conditions': [ ['OS=="linux"', { From bf71f9ca78227171054f7cc9ed1407d72aec02db Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Thu, 9 Apr 2015 10:49:36 +0800 Subject: [PATCH 33/45] Add flag to build with clang --- brightray.gypi | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/brightray.gypi b/brightray.gypi index 9f869c3..0154806 100644 --- a/brightray.gypi +++ b/brightray.gypi @@ -3,6 +3,9 @@ 'vendor/download/libchromiumcontent/filenames.gypi', ], 'variables': { + # Build with clang on Linux and Mac. + 'clang%': 1, + 'libchromiumcontent_src_dir': '<(libchromiumcontent_root_dir)/src', 'libchromiumcontent_component%': 1, 'conditions': [ @@ -274,8 +277,34 @@ }], # OS=="win" and libchromiumcontent_component==0 ], }, - }, + }, # target_defaults 'conditions': [ + ['clang', { + 'make_global_settings': [ + ['CC', '/usr/bin/clang'], + ['CXX', '/usr/bin/clang++'], + ['LINK', '$(CXX)'], + ['CC.host', '$(CC)'], + ['CXX.host', '$(CXX)'], + ['LINK.host', '$(LINK)'], + ], + 'target_defaults': { + 'cflags_cc': [ + '-std=c++11', + ], + 'xcode_settings': { + 'CC': '/usr/bin/clang', + 'LDPLUSPLUS': '/usr/bin/clang++', + 'OTHER_CFLAGS': [ + '-fcolor-diagnostics', + ], + + 'GCC_C_LANGUAGE_STANDARD': 'c99', # -std=c99 + 'CLANG_CXX_LIBRARY': 'libc++', # -stdlib=libc++ + 'CLANG_CXX_LANGUAGE_STANDARD': 'c++11', # -std=c++11 + }, + }, + }], # clang ['OS=="win"', { 'target_defaults': { 'include_dirs': [ From c735889888f8632e3dd9693e00a7988654baf7fd Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Thu, 9 Apr 2015 11:30:01 +0800 Subject: [PATCH 34/45] mac: "xcode_settings" doesn't work under "configurations" --- brightray.gypi | 55 ++++++++++++++++++++++++++++++++++---------------- 1 file changed, 38 insertions(+), 17 deletions(-) diff --git a/brightray.gypi b/brightray.gypi index 0154806..de00118 100644 --- a/brightray.gypi +++ b/brightray.gypi @@ -45,8 +45,6 @@ 'xcode_settings': { 'ALWAYS_SEARCH_USER_PATHS': 'NO', 'ARCHS': ['x86_64'], - 'CLANG_CXX_LANGUAGE_STANDARD': 'c++11', - 'CLANG_CXX_LIBRARY': 'libc++', 'COMBINE_HIDPI_IMAGES': 'YES', 'GCC_ENABLE_CPP_EXCEPTIONS': 'NO', 'GCC_ENABLE_CPP_RTTI': 'NO', @@ -168,10 +166,6 @@ ], }, }, - 'xcode_settings': { - 'COPY_PHASE_STRIP': 'NO', - 'GCC_OPTIMIZATION_LEVEL': '0', - }, }, # Debug_Base 'Release_Base': { 'msvs_settings': { @@ -203,16 +197,6 @@ }], ], }, - 'xcode_settings': { - 'DEAD_CODE_STRIPPING': 'YES', # -Wl,-dead_strip - 'GCC_OPTIMIZATION_LEVEL': '2', - 'OTHER_CFLAGS': [ - '-fno-inline', - '-fno-omit-frame-pointer', - '-fno-builtin', - '-fno-optimize-sibling-calls', - ], - }, }, 'conditions': [ ['OS=="linux"', { @@ -276,7 +260,35 @@ }, # R_x64 }], # OS=="win" and libchromiumcontent_component==0 ], - }, + }, # configurations + 'target_conditions': [ + # Putting this under "configurations" doesn't work. + ['libchromiumcontent_component', { + 'xcode_settings': { + 'GCC_OPTIMIZATION_LEVEL': '0', + }, + }, { # "Debug_Base" + 'xcode_settings': { + 'DEAD_CODE_STRIPPING': 'YES', # -Wl,-dead_strip + 'GCC_OPTIMIZATION_LEVEL': '2', + 'OTHER_CFLAGS': [ + '-fno-inline', + '-fno-omit-frame-pointer', + '-fno-builtin', + '-fno-optimize-sibling-calls', + ], + }, + }], # "Release_Base" + ['OS=="mac" and libchromiumcontent_component==0 and _type in ["executable", "shared_library"]', { + 'xcode_settings': { + # Generates symbols and strip the binary. + 'DEBUG_INFORMATION_FORMAT': 'dwarf-with-dsym', + 'DEPLOYMENT_POSTPROCESSING': 'YES', + 'STRIP_INSTALLED_PRODUCT': 'YES', + 'STRIPFLAGS': '-x', + }, + }], # OS=="mac" and libchromiumcontent_component==0 and _type in ["executable", "shared_library"] + ], # target_conditions }, # target_defaults 'conditions': [ ['clang', { @@ -303,6 +315,15 @@ 'CLANG_CXX_LIBRARY': 'libc++', # -stdlib=libc++ 'CLANG_CXX_LANGUAGE_STANDARD': 'c++11', # -std=c++11 }, + 'target_conditions': [ + ['_type in ["executable", "shared_library"]', { + 'xcode_settings': { + # On some machines setting CLANG_CXX_LIBRARY doesn't work for + # linker. + 'OTHER_LDFLAGS': [ '-stdlib=libc++' ], + }, + }], + ], }, }], # clang ['OS=="win"', { From 6832cc458a1ccbd547682998fcc62e58d789af11 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Thu, 9 Apr 2015 12:05:07 +0800 Subject: [PATCH 35/45] linux: Work around linker OOM on 32bit target --- brightray.gypi | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/brightray.gypi b/brightray.gypi index de00118..d71e2f4 100644 --- a/brightray.gypi +++ b/brightray.gypi @@ -202,6 +202,8 @@ ['OS=="linux"', { 'cflags': [ '-O2', + # Generate symbols, will be stripped later. + '-g', # Don't emit the GCC version ident directives, they just end up # in the .comment section taking up binary size. '-fno-ident', @@ -288,6 +290,12 @@ 'STRIPFLAGS': '-x', }, }], # OS=="mac" and libchromiumcontent_component==0 and _type in ["executable", "shared_library"] + ['OS=="linux" and target_arch=="ia32" and _toolset=="target"', { + 'ldflags': [ + # Workaround for linker OOM. + '-Wl,--no-keep-memory', + ], + }], ], # target_conditions }, # target_defaults 'conditions': [ From 3f5f7649b01f94cb85366bc12ab48e358f92276c Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Thu, 9 Apr 2015 13:30:21 +0800 Subject: [PATCH 36/45] win: Remove unused config variables --- brightray.gypi | 85 +++++++++----------------------------------------- 1 file changed, 15 insertions(+), 70 deletions(-) diff --git a/brightray.gypi b/brightray.gypi index d71e2f4..abea480 100644 --- a/brightray.gypi +++ b/brightray.gypi @@ -18,23 +18,6 @@ 'libchromiumcontent_libraries%': '<(libchromiumcontent_static_libraries)', }], ], - - # See http://msdn.microsoft.com/en-us/library/aa652360(VS.71).aspx - 'win_release_Optimization%': '2', # 2 = /Os - 'win_debug_Optimization%': '0', # 0 = /Od - - # See http://msdn.microsoft.com/en-us/library/2kxx5t2c(v=vs.80).aspx - # Tri-state: blank is default, 1 on, 0 off - 'win_release_OmitFramePointers%': '0', - # Tri-state: blank is default, 1 on, 0 off - 'win_debug_OmitFramePointers%': '', - - # See http://msdn.microsoft.com/en-us/library/8wtf2dfz(VS.71).aspx - 'win_debug_RuntimeChecks%': '3', # 3 = all checks enabled, 0 = off - - # See http://msdn.microsoft.com/en-us/library/47238hez(VS.71).aspx - 'win_debug_InlineFunctionExpansion%': '', # empty = default, 0 = off, - 'win_release_InlineFunctionExpansion%': '2', # 1 = only __inline, 2 = max }, 'target_defaults': { 'includes': [ @@ -137,65 +120,27 @@ 'msvs_settings': { 'VCCLCompilerTool': { 'RuntimeLibrary': '2', # /MD (nondebug DLL) - 'Optimization': '<(win_debug_Optimization)', - 'BasicRuntimeChecks': '<(win_debug_RuntimeChecks)', - 'conditions': [ - # According to MSVS, InlineFunctionExpansion=0 means - # "default inlining", not "/Ob0". - # Thus, we have to handle InlineFunctionExpansion==0 separately. - ['win_debug_InlineFunctionExpansion==0', { - 'AdditionalOptions': ['/Ob0'], - }], - ['win_debug_InlineFunctionExpansion!=""', { - 'InlineFunctionExpansion': - '<(win_debug_InlineFunctionExpansion)', - }], - # if win_debug_OmitFramePointers is blank, leave as default - ['win_debug_OmitFramePointers==1', { - 'OmitFramePointers': 'true', - }], - ['win_debug_OmitFramePointers==0', { - 'OmitFramePointers': 'false', - # The above is not sufficient (http://crbug.com/106711): it - # simply eliminates an explicit "/Oy", but both /O2 and /Ox - # perform FPO regardless, so we must explicitly disable. - # We still want the false setting above to avoid having - # "/Oy /Oy-" and warnings about overriding. - 'AdditionalOptions': ['/Oy-'], - }], - ], + 'Optimization': '0', # 0 = /Od + # See http://msdn.microsoft.com/en-us/library/8wtf2dfz(VS.71).aspx + 'BasicRuntimeChecks': '3', # 3 = all checks enabled, 0 = off }, }, }, # Debug_Base 'Release_Base': { 'msvs_settings': { 'VCCLCompilerTool': { - 'Optimization': '<(win_release_Optimization)', - 'conditions': [ - # According to MSVS, InlineFunctionExpansion=0 means - # "default inlining", not "/Ob0". - # Thus, we have to handle InlineFunctionExpansion==0 separately. - ['win_release_InlineFunctionExpansion==0', { - 'AdditionalOptions': ['/Ob0'], - }], - ['win_release_InlineFunctionExpansion!=""', { - 'InlineFunctionExpansion': - '<(win_release_InlineFunctionExpansion)', - }], - # if win_release_OmitFramePointers is blank, leave as default - ['win_release_OmitFramePointers==1', { - 'OmitFramePointers': 'true', - }], - ['win_release_OmitFramePointers==0', { - 'OmitFramePointers': 'false', - # The above is not sufficient (http://crbug.com/106711): it - # simply eliminates an explicit "/Oy", but both /O2 and /Ox - # perform FPO regardless, so we must explicitly disable. - # We still want the false setting above to avoid having - # "/Oy /Oy-" and warnings about overriding. - 'AdditionalOptions': ['/Oy-'], - }], - ], + # See http://msdn.microsoft.com/en-us/library/aa652360(VS.71).aspx + 'Optimization': '2', # 2 = /Os + # See http://msdn.microsoft.com/en-us/library/47238hez(VS.71).aspx + 'InlineFunctionExpansion': '2', # 2 = max + # See http://msdn.microsoft.com/en-us/library/2kxx5t2c(v=vs.80).aspx + 'OmitFramePointers': 'false', + # The above is not sufficient (http://crbug.com/106711): it + # simply eliminates an explicit "/Oy", but both /O2 and /Ox + # perform FPO regardless, so we must explicitly disable. + # We still want the false setting above to avoid having + # "/Oy /Oy-" and warnings about overriding. + 'AdditionalOptions': ['/Oy-'], }, }, 'conditions': [ From 1d51c9019a9ac1e46e90ee88581108e13e4aa01f Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Thu, 9 Apr 2015 13:38:54 +0800 Subject: [PATCH 37/45] win: No need to set default linked libraries --- brightray.gyp | 13 +++++++++++++ brightray.gypi | 17 ----------------- 2 files changed, 13 insertions(+), 17 deletions(-) diff --git a/brightray.gyp b/brightray.gyp index 5598d31..10313d2 100644 --- a/brightray.gyp +++ b/brightray.gyp @@ -170,6 +170,19 @@ ], 'msvs_settings': { 'VCLinkerTool': { + 'AdditionalDependencies': [ + 'advapi32.lib', + 'dbghelp.lib', + 'dwmapi.lib', + 'gdi32.lib', + 'netapi32.lib', + 'oleacc.lib', + 'powrprof.lib', + 'user32.lib', + 'usp10.lib', + 'version.lib', + 'winspool.lib', + ], 'DelayLoadDLLs': [ 'ffmpegsumo.dll', # content_common.gypi: diff --git a/brightray.gypi b/brightray.gypi index abea480..d90da93 100644 --- a/brightray.gypi +++ b/brightray.gypi @@ -67,23 +67,6 @@ 'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)', 'CharacterSet': '1', }, - 'msvs_settings': { - 'VCLinkerTool': { - 'AdditionalDependencies': [ - 'advapi32.lib', - 'dbghelp.lib', - 'dwmapi.lib', - 'gdi32.lib', - 'netapi32.lib', - 'oleacc.lib', - 'powrprof.lib', - 'user32.lib', - 'usp10.lib', - 'version.lib', - 'winspool.lib', - ], - }, - }, 'conditions': [ ['OS!="mac"', { 'defines': [ From ed724c2b0cde29b629367472786ead974c9fb94f Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Thu, 9 Apr 2015 14:03:42 +0800 Subject: [PATCH 38/45] win: Cleanup the compiler settings --- brightray.gypi | 169 ++++++++++++++++++++++++++++--------------------- 1 file changed, 96 insertions(+), 73 deletions(-) diff --git a/brightray.gypi b/brightray.gypi index d90da93..bfee41e 100644 --- a/brightray.gypi +++ b/brightray.gypi @@ -43,6 +43,71 @@ '-Wno-missing-field-initializers', ], }, + 'msvs_configuration_attributes': { + 'OutputDirectory': '<(DEPTH)\\build\\$(ConfigurationName)', + 'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)', + 'CharacterSet': '1', + }, + 'msvs_system_include_dirs': [ + '$(VSInstallDir)/VC/atlmfc/include', + ], + 'msvs_settings': { + 'VCCLCompilerTool': { + 'AdditionalOptions': ['/MP'], + 'MinimalRebuild': 'false', + 'BufferSecurityCheck': 'true', + 'EnableFunctionLevelLinking': 'true', + 'RuntimeTypeInfo': 'false', + 'WarningLevel': '4', + 'WarnAsError': 'true', + 'DebugInformationFormat': '3', + # Programs that use the Standard C++ library must be compiled with + # C++ + # exception handling enabled. + # http://support.microsoft.com/kb/154419 + 'ExceptionHandling': 1, + }, + 'VCLinkerTool': { + 'GenerateDebugInformation': 'true', + 'MapFileName': '$(OutDir)\\$(TargetName).map', + 'ImportLibrary': '$(OutDir)\\lib\\$(TargetName).lib', + 'LinkTimeCodeGeneration': 'true', # /LTCG + 'AdditionalOptions': [ + # ATL 8.0 included in WDK 7.1 makes the linker to generate + # following + # warnings: + # - warning LNK4254: section 'ATL' (50000040) merged into + # '.rdata' (40000040) with different attributes + # - warning LNK4078: multiple 'ATL' sections found with + # different attributes + '/ignore:4254', + '/ignore:4078', + # views_chromiumcontent.lib generates this warning because it's + # symobls are defined as dllexport but used as static library: + # - warning LNK4217: locally defined symbol imported in function + # - warning LNK4049: locally defined symbol imported + '/ignore:4217', + '/ignore:4049', + ], + }, + }, + 'msvs_disabled_warnings': [ + 4100, # unreferenced formal parameter + 4127, # conditional expression is constant + 4189, # local variable is initialized but not referenced + 4244, # 'initializing' : conversion from 'double' to 'size_t', possible loss of data + 4245, # 'initializing' : conversion from 'int' to 'const net::QuicVersionTag', signed/unsigned mismatch + 4251, # class 'std::xx' needs to have dll-interface. + 4310, # cast truncates constant value + 4355, # 'this' : used in base member initializer list + 4480, # nonstandard extension used: specifying underlying type for enum + 4481, # nonstandard extension used: override specifier 'override' + 4510, # default constructor could not be generated + 4512, # assignment operator could not be generated + 4610, # user defined constructor required + 4702, # unreachable code + 4819, # The file contains a character that cannot be represented in the current code page + ], 'configurations': { # The "Debug" and "Release" configurations are not actually used. 'Debug': {}, @@ -62,11 +127,6 @@ 'SK_IGNORE_ETC1_SUPPORT', 'SK_IGNORE_GPU_DITHER', ], - 'msvs_configuration_attributes': { - 'OutputDirectory': '<(DEPTH)\\build\\$(ConfigurationName)', - 'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)', - 'CharacterSet': '1', - }, 'conditions': [ ['OS!="mac"', { 'defines': [ @@ -86,6 +146,24 @@ '-fno-rtti', ], }], # OS=="linux" + ['OS=="win"', { + 'include_dirs': [ + '<(libchromiumcontent_src_dir)/third_party/wtl/include', + ], + 'defines': [ + '_WIN32_WINNT=0x0602', + 'WINVER=0x0602', + 'WIN32', + '_WINDOWS', + 'NOMINMAX', + 'PSAPI_VERSION=1', + '_CRT_RAND_S', + 'CERT_CHAIN_PARA_HAS_EXTRA_FIELDS', + 'WIN32_LEAN_AND_MEAN', + '_ATL_NO_OPENGL', + '_SECURE_ATL', + ], + }], # OS=="win" ], }, # Common_Base 'Debug_Base': { @@ -112,8 +190,9 @@ 'Release_Base': { 'msvs_settings': { 'VCCLCompilerTool': { - # See http://msdn.microsoft.com/en-us/library/aa652360(VS.71).aspx 'Optimization': '2', # 2 = /Os + 'FavorSizeOrSpeed': '1', # 1 = /Ot + 'WholeProgramOptimization': 'true', # See http://msdn.microsoft.com/en-us/library/47238hez(VS.71).aspx 'InlineFunctionExpansion': '2', # 2 = max # See http://msdn.microsoft.com/en-us/library/2kxx5t2c(v=vs.80).aspx @@ -178,17 +257,18 @@ }, }, }, # x64_Base + 'conditions': [ + ['libchromiumcontent_component', { + 'D_x64': { + 'inherit_from': ['Common_Base', 'x64_Base', 'Debug_Base'], + }, # D_x64 + }, { + 'R_x64': { + 'inherit_from': ['Common_Base', 'x64_Base', 'Release_Base'], + }, # R_x64 + }], # libchromiumcontent_component + ], }], # OS=="win" - ['OS=="win" and libchromiumcontent_component==1', { - 'D_x64': { - 'inherit_from': ['Common_Base', 'x64_Base', 'Debug_Base'], - }, # D_x64 - }], # OS=="win" and libchromiumcontent_component==1 - ['OS=="win" and libchromiumcontent_component==0', { - 'R_x64': { - 'inherit_from': ['Common_Base', 'x64_Base', 'Release_Base'], - }, # R_x64 - }], # OS=="win" and libchromiumcontent_component==0 ], }, # configurations 'target_conditions': [ @@ -262,62 +342,5 @@ ], }, }], # clang - ['OS=="win"', { - 'target_defaults': { - 'include_dirs': [ - '<(libchromiumcontent_src_dir)/third_party/wtl/include', - ], - 'defines': [ - '_WIN32_WINNT=0x0602', - 'WINVER=0x0602', - 'WIN32', - '_WINDOWS', - 'NOMINMAX', - 'PSAPI_VERSION=1', - '_CRT_RAND_S', - 'CERT_CHAIN_PARA_HAS_EXTRA_FIELDS', - 'WIN32_LEAN_AND_MEAN', - '_ATL_NO_OPENGL', - '_SECURE_ATL', - ], - 'msvs_system_include_dirs': [ - '$(VSInstallDir)/VC/atlmfc/include', - ], - 'msvs_settings': { - 'VCCLCompilerTool': { - 'AdditionalOptions': ['/MP'], - 'MinimalRebuild': 'false', - 'BufferSecurityCheck': 'true', - 'EnableFunctionLevelLinking': 'true', - 'RuntimeTypeInfo': 'false', - 'WarningLevel': '4', - 'WarnAsError': 'true', - 'DebugInformationFormat': '3', - }, - 'VCLinkerTool': { - 'GenerateDebugInformation': 'true', - 'MapFileName': '$(OutDir)\\$(TargetName).map', - 'ImportLibrary': '$(OutDir)\\lib\\$(TargetName).lib', - }, - }, - 'msvs_disabled_warnings': [ - 4100, # unreferenced formal parameter - 4127, # conditional expression is constant - 4189, # local variable is initialized but not referenced - 4244, # 'initializing' : conversion from 'double' to 'size_t', possible loss of data - 4245, # 'initializing' : conversion from 'int' to 'const net::QuicVersionTag', signed/unsigned mismatch - 4251, # class 'std::xx' needs to have dll-interface. - 4310, # cast truncates constant value - 4355, # 'this' : used in base member initializer list - 4480, # nonstandard extension used: specifying underlying type for enum - 4481, # nonstandard extension used: override specifier 'override' - 4510, # default constructor could not be generated - 4512, # assignment operator could not be generated - 4610, # user defined constructor required - 4702, # unreachable code - 4819, # The file contains a character that cannot be represented in the current code page - ], - }, - }], ], } From 21ab1efb09e8f7efa5591dc4c989f7012025a133 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Thu, 9 Apr 2015 14:39:52 +0800 Subject: [PATCH 39/45] win: Do not use link time code generation It causes problems on Windows --- brightray.gypi | 2 -- 1 file changed, 2 deletions(-) diff --git a/brightray.gypi b/brightray.gypi index bfee41e..f643b55 100644 --- a/brightray.gypi +++ b/brightray.gypi @@ -71,7 +71,6 @@ 'GenerateDebugInformation': 'true', 'MapFileName': '$(OutDir)\\$(TargetName).map', 'ImportLibrary': '$(OutDir)\\lib\\$(TargetName).lib', - 'LinkTimeCodeGeneration': 'true', # /LTCG 'AdditionalOptions': [ # ATL 8.0 included in WDK 7.1 makes the linker to generate # following @@ -192,7 +191,6 @@ 'VCCLCompilerTool': { 'Optimization': '2', # 2 = /Os 'FavorSizeOrSpeed': '1', # 1 = /Ot - 'WholeProgramOptimization': 'true', # See http://msdn.microsoft.com/en-us/library/47238hez(VS.71).aspx 'InlineFunctionExpansion': '2', # 2 = max # See http://msdn.microsoft.com/en-us/library/2kxx5t2c(v=vs.80).aspx From 1b62aab98e1e79f6357bd156fc2a43068d4a3f49 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Thu, 9 Apr 2015 20:47:47 +0800 Subject: [PATCH 40/45] Separate V8 libraries from other libraries --- brightray.gypi | 2 ++ vendor/libchromiumcontent | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/brightray.gypi b/brightray.gypi index f643b55..d626326 100644 --- a/brightray.gypi +++ b/brightray.gypi @@ -13,9 +13,11 @@ ['libchromiumcontent_component', { 'libchromiumcontent_dir%': '<(libchromiumcontent_root_dir)/shared_library', 'libchromiumcontent_libraries%': '<(libchromiumcontent_shared_libraries)', + 'libchromiumcontent_v8_libraries%': '<(libchromiumcontent_shared_v8_libraries)', }, { 'libchromiumcontent_dir%': '<(libchromiumcontent_root_dir)/static_library', 'libchromiumcontent_libraries%': '<(libchromiumcontent_static_libraries)', + 'libchromiumcontent_v8_libraries%': '<(libchromiumcontent_static_v8_libraries)', }], ], }, diff --git a/vendor/libchromiumcontent b/vendor/libchromiumcontent index 09c2eb3..fdfaa8d 160000 --- a/vendor/libchromiumcontent +++ b/vendor/libchromiumcontent @@ -1 +1 @@ -Subproject commit 09c2eb301ceb50f1ae01f9ba7af4a2adf77a4d87 +Subproject commit fdfaa8d1e4f1a9a54bf679bbfdb5bf0a3af49399 From 0f37e5fa4d5273f80c91d485e0ce6edef683a26e Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Fri, 10 Apr 2015 12:06:55 +0800 Subject: [PATCH 41/45] Fix including icu libraries --- vendor/libchromiumcontent | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vendor/libchromiumcontent b/vendor/libchromiumcontent index fdfaa8d..44cb29a 160000 --- a/vendor/libchromiumcontent +++ b/vendor/libchromiumcontent @@ -1 +1 @@ -Subproject commit fdfaa8d1e4f1a9a54bf679bbfdb5bf0a3af49399 +Subproject commit 44cb29a12cf2b93064ce77a1be94528a535016f4 From 14b4dc7151ded676d7133f0da17033149a4954df Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Fri, 10 Apr 2015 18:49:19 +0800 Subject: [PATCH 42/45] No longer link with shared library of boringssl --- brightray.gyp | 6 ------ vendor/libchromiumcontent | 2 +- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/brightray.gyp b/brightray.gyp index 10313d2..42e0877 100644 --- a/brightray.gyp +++ b/brightray.gyp @@ -81,8 +81,6 @@ }, { 'link_settings': { 'libraries': [ - # libboringssl is always linked dynamically. - '<(libchromiumcontent_dir)/libboringssl.so', # Following libraries are required by libchromiumcontent: '-lasound', '-lcap', @@ -109,9 +107,6 @@ ['OS=="mac" and libchromiumcontent_component==0', { 'link_settings': { 'libraries': [ - # This library is built as shared library to avoid symbols - # conflict with Node. - '<(libchromiumcontent_dir)/libboringssl.dylib', # ui_base.gypi: '$(SDKROOT)/System/Library/Frameworks/Accelerate.framework', # net.gypi: @@ -152,7 +147,6 @@ ['OS=="win" and libchromiumcontent_component==0', { 'link_settings': { 'libraries': [ - '<(libchromiumcontent_dir)/boringssl.dll', '<(libchromiumcontent_dir)/ffmpegsumo.lib', '<(libchromiumcontent_dir)/libyuv.lib', # content_browser.gypi: diff --git a/vendor/libchromiumcontent b/vendor/libchromiumcontent index 44cb29a..a325ed7 160000 --- a/vendor/libchromiumcontent +++ b/vendor/libchromiumcontent @@ -1 +1 @@ -Subproject commit 44cb29a12cf2b93064ce77a1be94528a535016f4 +Subproject commit a325ed7b30bf0680881783edd92ca235b5468e11 From 9b4018b24a1812fb2a073ff297f103f0df319db1 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Sat, 11 Apr 2015 12:06:33 +0800 Subject: [PATCH 43/45] Debug_Base and Release_Base configs are abstract --- brightray.gypi | 2 ++ 1 file changed, 2 insertions(+) diff --git a/brightray.gypi b/brightray.gypi index d626326..db1ee86 100644 --- a/brightray.gypi +++ b/brightray.gypi @@ -168,6 +168,7 @@ ], }, # Common_Base 'Debug_Base': { + 'abstract': 1, 'defines': [ # Use this instead of "NDEBUG" to determine whether we are in # Debug build, because "NDEBUG" is already used by Chromium. @@ -189,6 +190,7 @@ }, }, # Debug_Base 'Release_Base': { + 'abstract': 1, 'msvs_settings': { 'VCCLCompilerTool': { 'Optimization': '2', # 2 = /Os From f2b33daa4ea5a1e1ba0a5b18a3f0470d99b6f962 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Sat, 11 Apr 2015 13:26:29 +0800 Subject: [PATCH 44/45] Cleanup the brightray.gyp file --- brightray.gyp | 179 ++++++++++++++++++++++++++------------------------ 1 file changed, 94 insertions(+), 85 deletions(-) diff --git a/brightray.gyp b/brightray.gyp index 42e0877..55b597b 100644 --- a/brightray.gyp +++ b/brightray.gyp @@ -44,11 +44,12 @@ '-Wl,--no-whole-archive', ], } - }, { + }, { # (Release build on Linux) 'link_settings': { 'libraries': [ '<@(libchromiumcontent_libraries)' ] }, - }], + }], # (Normal builds) + # Linux specific link settings. ['OS=="linux"', { 'link_settings': { 'ldflags': [ @@ -96,99 +97,107 @@ }, }], ], - }], + }], # OS=="linux" ['OS=="mac"', { 'link_settings': { 'libraries': [ '$(SDKROOT)/System/Library/Frameworks/AppKit.framework', ], }, - }], - ['OS=="mac" and libchromiumcontent_component==0', { - 'link_settings': { - 'libraries': [ - # ui_base.gypi: - '$(SDKROOT)/System/Library/Frameworks/Accelerate.framework', - # net.gypi: - '$(SDKROOT)/System/Library/Frameworks/Foundation.framework', - '$(SDKROOT)/System/Library/Frameworks/Security.framework', - '$(SDKROOT)/System/Library/Frameworks/SystemConfiguration.framework', - '$(SDKROOT)/usr/lib/libresolv.dylib', - # media.gyp: - '$(SDKROOT)/System/Library/Frameworks/AudioToolbox.framework', - '$(SDKROOT)/System/Library/Frameworks/AudioUnit.framework', - '$(SDKROOT)/System/Library/Frameworks/CoreAudio.framework', - '$(SDKROOT)/System/Library/Frameworks/CoreMIDI.framework', - '$(SDKROOT)/System/Library/Frameworks/CoreVideo.framework', - '$(SDKROOT)/System/Library/Frameworks/OpenGL.framework', - '$(SDKROOT)/System/Library/Frameworks/QTKit.framework', - # surface.gyp: - '$(SDKROOT)/System/Library/Frameworks/IOSurface.framework', - # content_common.gypi: - '$(SDKROOT)/System/Library/Frameworks/QuartzCore.framework', - # base.gyp: - '$(SDKROOT)/System/Library/Frameworks/ApplicationServices.framework', - '$(SDKROOT)/System/Library/Frameworks/Carbon.framework', - '$(SDKROOT)/System/Library/Frameworks/CoreFoundation.framework', - '$(SDKROOT)/System/Library/Frameworks/IOKit.framework', - # content_browser.gypi: - '$(SDKROOT)/usr/lib/libbsm.dylib', - ], - }, - }], - ['OS=="win" and libchromiumcontent_component==1', { - 'link_settings': { - 'libraries': [ - '<(libchromiumcontent_dir)/base_static.lib', - '<(libchromiumcontent_dir)/sandbox.lib', - ], - }, - }], - ['OS=="win" and libchromiumcontent_component==0', { - 'link_settings': { - 'libraries': [ - '<(libchromiumcontent_dir)/ffmpegsumo.lib', - '<(libchromiumcontent_dir)/libyuv.lib', - # content_browser.gypi: - '-lsensorsapi.lib', - '-lportabledeviceguids.lib', - # content_common.gypi: - '-ld3d9.lib', - '-ldxva2.lib', - '-lstrmiids.lib', - '-lmf.lib', - '-lmfplat.lib', - '-lmfuuid.lib', - # media.gyp: - '-lmfreadwrite.lib', - ], - 'msvs_settings': { - 'VCLinkerTool': { - 'AdditionalDependencies': [ - 'advapi32.lib', - 'dbghelp.lib', - 'dwmapi.lib', - 'gdi32.lib', - 'netapi32.lib', - 'oleacc.lib', - 'powrprof.lib', - 'user32.lib', - 'usp10.lib', - 'version.lib', - 'winspool.lib', + 'conditions': [ + # Link with system frameworks. + ['libchromiumcontent_component==0', { + 'link_settings': { + 'libraries': [ + # ui_base.gypi: + '$(SDKROOT)/System/Library/Frameworks/Accelerate.framework', + # net.gypi: + '$(SDKROOT)/System/Library/Frameworks/Foundation.framework', + '$(SDKROOT)/System/Library/Frameworks/Security.framework', + '$(SDKROOT)/System/Library/Frameworks/SystemConfiguration.framework', + '$(SDKROOT)/usr/lib/libresolv.dylib', + # media.gyp: + '$(SDKROOT)/System/Library/Frameworks/AudioToolbox.framework', + '$(SDKROOT)/System/Library/Frameworks/AudioUnit.framework', + '$(SDKROOT)/System/Library/Frameworks/CoreAudio.framework', + '$(SDKROOT)/System/Library/Frameworks/CoreMIDI.framework', + '$(SDKROOT)/System/Library/Frameworks/CoreVideo.framework', + '$(SDKROOT)/System/Library/Frameworks/OpenGL.framework', + '$(SDKROOT)/System/Library/Frameworks/QTKit.framework', + # surface.gyp: + '$(SDKROOT)/System/Library/Frameworks/IOSurface.framework', + # content_common.gypi: + '$(SDKROOT)/System/Library/Frameworks/QuartzCore.framework', + # base.gyp: + '$(SDKROOT)/System/Library/Frameworks/ApplicationServices.framework', + '$(SDKROOT)/System/Library/Frameworks/Carbon.framework', + '$(SDKROOT)/System/Library/Frameworks/CoreFoundation.framework', + '$(SDKROOT)/System/Library/Frameworks/IOKit.framework', + # content_browser.gypi: + '$(SDKROOT)/usr/lib/libbsm.dylib', ], - 'DelayLoadDLLs': [ - 'ffmpegsumo.dll', + }, + }], + ] + }], # OS=="mac" + ['OS=="win"', { + 'conditions': [ + ['libchromiumcontent_component', { + # sandbox and base_static are always linked statically. + 'link_settings': { + 'libraries': [ + '<(libchromiumcontent_dir)/base_static.lib', + '<(libchromiumcontent_dir)/sandbox.lib', + ], + }, + }, { + # Link with system libraries. + 'link_settings': { + 'libraries': [ + # ffmpegsumo.lib is required for linking with ffmpegsumo.dll + '<(libchromiumcontent_dir)/ffmpegsumo.lib', + # content_browser.gypi: + '-lsensorsapi.lib', + '-lportabledeviceguids.lib', # content_common.gypi: - 'd3d9.dll', - 'dxva2.dll', - 'mf.dll', - 'mfplat.dll', + '-ld3d9.lib', + '-ldxva2.lib', + '-lstrmiids.lib', + '-lmf.lib', + '-lmfplat.lib', + '-lmfuuid.lib', + # media.gyp: + '-lmfreadwrite.lib', ], + 'msvs_settings': { + 'VCLinkerTool': { + 'AdditionalDependencies': [ + 'advapi32.lib', + 'dbghelp.lib', + 'dwmapi.lib', + 'gdi32.lib', + 'netapi32.lib', + 'oleacc.lib', + 'powrprof.lib', + 'user32.lib', + 'usp10.lib', + 'version.lib', + 'winspool.lib', + ], + 'DelayLoadDLLs': [ + 'ffmpegsumo.dll', + # content_common.gypi: + 'd3d9.dll', + 'dxva2.dll', + 'mf.dll', + 'mfplat.dll', + ], + }, + }, }, - }, - }, - }], + }], # libchromiumcontent_component + ], + }], # OS=="win" ], }, ], From 0efd9f73ffe1e626fc19ff1b0f570f28c9e6d833 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Sat, 11 Apr 2015 13:43:02 +0800 Subject: [PATCH 45/45] Set libchromiumcontent_component when bootstrapping --- script/build | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/script/build b/script/build index 30ee528..6ee7da9 100755 --- a/script/build +++ b/script/build @@ -19,8 +19,9 @@ def run_gyp(): gyp_pylib = os.path.join(os.path.dirname(GYP), 'pylib') env['PYTHONPATH'] = os.path.pathsep.join([gyp_pylib, env.get('PYTHONPATH', '')]) + env['GYP_DEFINES'] = 'libchromiumcontent_component=static_library' return subprocess.call([sys.executable, GYP, '--depth', '.', - 'brightray.gyp'], env=env) + '-Ibrightray.gypi', 'brightray.gyp'], env=env) def build():