linux: Improve building flags for Release build
This commit is contained in:
parent
2ef9e85f5e
commit
62d845f09e
2 changed files with 60 additions and 25 deletions
|
@ -93,6 +93,7 @@
|
||||||
'common/main_delegate_mac.mm',
|
'common/main_delegate_mac.mm',
|
||||||
],
|
],
|
||||||
'conditions': [
|
'conditions': [
|
||||||
|
# Link with libraries of libchromiumcontent.
|
||||||
['OS=="linux" and libchromiumcontent_component==0', {
|
['OS=="linux" and libchromiumcontent_component==0', {
|
||||||
# On Linux we have to use "--whole-archive" to force executable
|
# On Linux we have to use "--whole-archive" to force executable
|
||||||
# to include all symbols, otherwise we will have plenty of
|
# to include all symbols, otherwise we will have plenty of
|
||||||
|
@ -110,30 +111,43 @@
|
||||||
},
|
},
|
||||||
}],
|
}],
|
||||||
['OS=="linux"', {
|
['OS=="linux"', {
|
||||||
'cflags_cc': [
|
'variables': {
|
||||||
'-Wno-deprecated-register',
|
'system_libraries': 'gtk+-2.0 libnotify dbus-1 x11 xrandr xext gconf-2.0',
|
||||||
'-fno-rtti',
|
},
|
||||||
],
|
|
||||||
'link_settings': {
|
'link_settings': {
|
||||||
'ldflags': [
|
'ldflags': [
|
||||||
'<!@(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 <(system_libraries))',
|
||||||
],
|
],
|
||||||
'libraries': [
|
'libraries': [
|
||||||
'-lpthread',
|
'-lpthread',
|
||||||
'<!@(pkg-config --libs-only-l gtk+-2.0 libnotify dbus-1 x11 xrandr xext gconf-2.0)',
|
'<!@(pkg-config --libs-only-l <(system_libraries))',
|
||||||
|
],
|
||||||
|
},
|
||||||
|
'cflags': [
|
||||||
|
'<!@(pkg-config --cflags <(system_libraries))',
|
||||||
|
# Needed by using libgtk2ui:
|
||||||
|
'-Wno-deprecated-register',
|
||||||
|
],
|
||||||
|
'direct_dependent_settings': {
|
||||||
|
'cflags': [
|
||||||
|
'<!@(pkg-config --cflags <(system_libraries))',
|
||||||
|
'-Wno-deprecated-register',
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
'conditions': [
|
'conditions': [
|
||||||
['libchromiumcontent_component', {
|
['libchromiumcontent_component', {
|
||||||
'link_settings': {
|
'link_settings': {
|
||||||
'libraries': [
|
'libraries': [
|
||||||
|
# libgtk2ui is always linked statically.
|
||||||
'<(libchromiumcontent_dir)/libgtk2ui.a',
|
'<(libchromiumcontent_dir)/libgtk2ui.a',
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
}, {
|
}, {
|
||||||
'link_settings': {
|
'link_settings': {
|
||||||
'libraries': [
|
'libraries': [
|
||||||
|
# libboringssl is always linked dynamically.
|
||||||
'<(libchromiumcontent_dir)/libboringssl.so',
|
'<(libchromiumcontent_dir)/libboringssl.so',
|
||||||
|
# Following libraries are required by libchromiumcontent:
|
||||||
'-lasound',
|
'-lasound',
|
||||||
'-lcap',
|
'-lcap',
|
||||||
'-lcups',
|
'-lcups',
|
||||||
|
|
|
@ -110,9 +110,27 @@
|
||||||
'USE_X11',
|
'USE_X11',
|
||||||
],
|
],
|
||||||
}],
|
}],
|
||||||
|
['OS=="linux"', {
|
||||||
|
'cflags_cc': [
|
||||||
|
'-D__STRICT_ANSI__',
|
||||||
|
'-std=gnu++11',
|
||||||
|
'-fno-rtti',
|
||||||
|
],
|
||||||
|
}], # OS=="linux"
|
||||||
],
|
],
|
||||||
}, # Common_Base
|
}, # Common_Base
|
||||||
'Debug_Base': {
|
'Debug_Base': {
|
||||||
|
'defines': [
|
||||||
|
# Use this instead of "NDEBUG" to determine whether we are in
|
||||||
|
# Debug build, because "NDEBUG" is already used by Chromium.
|
||||||
|
'DEBUG',
|
||||||
|
# Require when using libchromiumcontent.
|
||||||
|
'COMPONENT_BUILD',
|
||||||
|
'GURL_DLL',
|
||||||
|
'SKIA_DLL',
|
||||||
|
'USING_V8_SHARED',
|
||||||
|
'WEBKIT_DLL',
|
||||||
|
],
|
||||||
'msvs_settings': {
|
'msvs_settings': {
|
||||||
'VCCLCompilerTool': {
|
'VCCLCompilerTool': {
|
||||||
'RuntimeLibrary': '2', # /MD (nondebug DLL)
|
'RuntimeLibrary': '2', # /MD (nondebug DLL)
|
||||||
|
@ -181,6 +199,27 @@
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
'conditions': [
|
||||||
|
['OS=="linux"', {
|
||||||
|
'cflags': [
|
||||||
|
'-O2',
|
||||||
|
# Don't emit the GCC version ident directives, they just end up
|
||||||
|
# in the .comment section taking up binary size.
|
||||||
|
'-fno-ident',
|
||||||
|
# Put data and code in their own sections, so that unused symbols
|
||||||
|
# can be removed at link time with --gc-sections.
|
||||||
|
'-fdata-sections',
|
||||||
|
'-ffunction-sections',
|
||||||
|
],
|
||||||
|
'ldflags': [
|
||||||
|
# Specifically tell the linker to perform optimizations.
|
||||||
|
# See http://lwn.net/Articles/192624/ .
|
||||||
|
'-Wl,-O1',
|
||||||
|
'-Wl,--as-needed',
|
||||||
|
'-Wl,--gc-sections',
|
||||||
|
],
|
||||||
|
}], # OS=="linux"
|
||||||
|
],
|
||||||
}, # Release_Base
|
}, # Release_Base
|
||||||
'conditions': [
|
'conditions': [
|
||||||
['libchromiumcontent_component', {
|
['libchromiumcontent_component', {
|
||||||
|
@ -241,14 +280,7 @@
|
||||||
['exclude', '_win\.(cc|h)$'],
|
['exclude', '_win\.(cc|h)$'],
|
||||||
],
|
],
|
||||||
}],
|
}],
|
||||||
['OS=="linux"', {
|
['OS!="linux"', {
|
||||||
'cflags_cc': [
|
|
||||||
'-D__STRICT_ANSI__',
|
|
||||||
'-std=gnu++11',
|
|
||||||
'-fno-rtti',
|
|
||||||
'<!@(pkg-config --cflags gtk+-2.0)',
|
|
||||||
],
|
|
||||||
}, {
|
|
||||||
'sources/': [
|
'sources/': [
|
||||||
['exclude', '/linux/'],
|
['exclude', '/linux/'],
|
||||||
['exclude', '_linux\.(cc|h)$'],
|
['exclude', '_linux\.(cc|h)$'],
|
||||||
|
@ -257,17 +289,6 @@
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
'conditions': [
|
'conditions': [
|
||||||
['libchromiumcontent_component', {
|
|
||||||
'target_defaults': {
|
|
||||||
'defines': [
|
|
||||||
'COMPONENT_BUILD',
|
|
||||||
'GURL_DLL',
|
|
||||||
'SKIA_DLL',
|
|
||||||
'USING_V8_SHARED',
|
|
||||||
'WEBKIT_DLL',
|
|
||||||
],
|
|
||||||
},
|
|
||||||
}],
|
|
||||||
['OS=="win"', {
|
['OS=="win"', {
|
||||||
'target_defaults': {
|
'target_defaults': {
|
||||||
'include_dirs': [
|
'include_dirs': [
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue