Commit fd36ce82 authored by piman@chromium.org's avatar piman@chromium.org

This does a few things:

- only include cflags/linkflags and other compiler settings that are target-specific when building for 'target'
- make build tools (protoc) compile for 'host', and change the dependencies on them to reflect that.

Review URL: http://codereview.chromium.org/265031

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30381 0039d316-1c4b-4281-b951-d872f2087c98
parent 23297923
...@@ -667,8 +667,8 @@ ...@@ -667,8 +667,8 @@
], ],
}], }],
['target_arch=="arm"', { ['target_arch=="arm"', {
'conditions': [ 'target_conditions': [
['armv7==1', { ['armv7==1 and _toolset=="target"', {
'cflags': [ 'cflags': [
'-march=armv7-a', '-march=armv7-a',
'-mtune=cortex-a8', '-mtune=cortex-a8',
...@@ -679,12 +679,15 @@ ...@@ -679,12 +679,15 @@
], ],
}], }],
['sysroot!=""', { ['sysroot!=""', {
'cflags': [ 'target_conditions': [
'--sysroot=<(sysroot)', ['_toolset=="target"', {
], 'cflags': [
'ldflags': [ '--sysroot=<(sysroot)',
'--sysroot=<(sysroot)', ],
], 'ldflags': [
'--sysroot=<(sysroot)',
],
}]]
}], }],
['no_strict_aliasing==1', { ['no_strict_aliasing==1', {
'cflags': [ 'cflags': [
......
...@@ -19,147 +19,174 @@ ...@@ -19,147 +19,174 @@
{ {
'target_name': 'gtk', 'target_name': 'gtk',
'type': 'settings', 'type': 'settings',
'direct_dependent_settings': { 'conditions': [
'cflags': [ ['_toolset=="target"', {
'<!@(<(pkg-config) --cflags gtk+-2.0 gthread-2.0)', 'direct_dependent_settings': {
], 'cflags': [
}, '<!@(<(pkg-config) --cflags gtk+-2.0 gthread-2.0)',
'link_settings': { ],
'ldflags': [ },
'<!@(<(pkg-config) --libs-only-L --libs-only-other gtk+-2.0 gthread-2.0)', 'link_settings': {
], 'ldflags': [
'libraries': [ '<!@(<(pkg-config) --libs-only-L --libs-only-other gtk+-2.0 gthread-2.0)',
'<!@(<(pkg-config) --libs-only-l gtk+-2.0 gthread-2.0)', ],
], 'libraries': [
}, '<!@(<(pkg-config) --libs-only-l gtk+-2.0 gthread-2.0)',
],
},
}]]
}, },
{ {
'target_name': 'gtkprint', 'target_name': 'gtkprint',
'type': 'settings', 'type': 'settings',
'direct_dependent_settings': { 'conditions': [
'cflags': [ ['_toolset=="target"', {
'<!@(<(pkg-config) --cflags gtk+-unix-print-2.0)', 'direct_dependent_settings': {
], 'cflags': [
}, '<!@(<(pkg-config) --cflags gtk+-unix-print-2.0)',
'link_settings': { ],
'ldflags': [ },
'<!@(<(pkg-config) --libs-only-L --libs-only-other gtk+-unix-print-2.0)', 'link_settings': {
], 'ldflags': [
'libraries': [ '<!@(<(pkg-config) --libs-only-L --libs-only-other gtk+-unix-print-2.0)',
'<!@(<(pkg-config) --libs-only-l gtk+-unix-print-2.0)', ],
], 'libraries': [
}, '<!@(<(pkg-config) --libs-only-l gtk+-unix-print-2.0)',
],
},
}]]
}, },
{ {
'target_name': 'nss', 'target_name': 'nss',
'type': 'settings', 'type': 'settings',
'direct_dependent_settings': { 'conditions': [
'cflags': [ ['_toolset=="target"', {
'<!@(<(pkg-config) --cflags nss)', 'direct_dependent_settings': {
], 'cflags': [
}, '<!@(<(pkg-config) --cflags nss)',
'link_settings': { ],
'ldflags': [ },
'<!@(<(pkg-config) --libs-only-L --libs-only-other nss)', 'link_settings': {
], 'ldflags': [
'libraries': [ '<!@(<(pkg-config) --libs-only-L --libs-only-other nss)',
'<!@(<(pkg-config) --libs-only-l nss)', ],
], 'libraries': [
}, '<!@(<(pkg-config) --libs-only-l nss)',
],
},
}]]
}, },
{ {
'target_name': 'freetype2', 'target_name': 'freetype2',
'type': 'settings', 'type': 'settings',
'direct_dependent_settings': { 'conditions': [
'cflags': [ ['_toolset=="target"', {
'<!@(<(pkg-config) --cflags freetype2)', 'direct_dependent_settings': {
], 'cflags': [
}, '<!@(<(pkg-config) --cflags freetype2)',
'link_settings': { ],
'ldflags': [ },
'<!@(<(pkg-config) --libs-only-L --libs-only-other freetype2)', 'link_settings': {
], 'ldflags': [
'libraries': [ '<!@(<(pkg-config) --libs-only-L --libs-only-other freetype2)',
'<!@(<(pkg-config) --libs-only-l freetype2)', ],
], 'libraries': [
}, '<!@(<(pkg-config) --libs-only-l freetype2)',
],
},
}]]
}, },
{ {
'target_name': 'fontconfig', 'target_name': 'fontconfig',
'type': 'settings', 'type': 'settings',
'direct_dependent_settings': { 'conditions': [
'cflags': [ ['_toolset=="target"', {
'<!@(<(pkg-config) --cflags fontconfig)', 'direct_dependent_settings': {
], 'cflags': [
}, '<!@(<(pkg-config) --cflags fontconfig)',
'link_settings': { ],
'ldflags': [ },
'<!@(<(pkg-config) --libs-only-L --libs-only-other fontconfig)', 'link_settings': {
], 'ldflags': [
'libraries': [ '<!@(<(pkg-config) --libs-only-L --libs-only-other fontconfig)',
'<!@(<(pkg-config) --libs-only-l fontconfig)', ],
], 'libraries': [
}, '<!@(<(pkg-config) --libs-only-l fontconfig)',
],
},
}]]
}, },
{ {
'target_name': 'gdk', 'target_name': 'gdk',
'type': 'settings', 'type': 'settings',
'direct_dependent_settings': { 'conditions': [
'cflags': [ ['_toolset=="target"', {
'<!@(<(pkg-config) --cflags gdk-2.0)', 'direct_dependent_settings': {
], 'cflags': [
}, '<!@(<(pkg-config) --cflags gdk-2.0)',
'link_settings': { ],
'ldflags': [ },
'<!@(<(pkg-config) --libs-only-L --libs-only-other gdk-2.0)', 'link_settings': {
], 'ldflags': [
'libraries': [ '<!@(<(pkg-config) --libs-only-L --libs-only-other gdk-2.0)',
'<!@(<(pkg-config) --libs-only-l gdk-2.0)', ],
], 'libraries': [
}, '<!@(<(pkg-config) --libs-only-l gdk-2.0)',
],
},
}]]
}, },
{ {
'target_name': 'gconf', 'target_name': 'gconf',
'type': 'settings', 'type': 'settings',
'direct_dependent_settings': { 'conditions': [
'cflags': [ ['_toolset=="target"', {
'<!@(<(pkg-config) --cflags gconf-2.0)', 'direct_dependent_settings': {
], 'cflags': [
}, '<!@(<(pkg-config) --cflags gconf-2.0)',
'link_settings': { ],
'ldflags': [ },
'<!@(<(pkg-config) --libs-only-L --libs-only-other gconf-2.0)', 'link_settings': {
], 'ldflags': [
'libraries': [ '<!@(<(pkg-config) --libs-only-L --libs-only-other gconf-2.0)',
'<!@(<(pkg-config) --libs-only-l gconf-2.0)', ],
], 'libraries': [
}, '<!@(<(pkg-config) --libs-only-l gconf-2.0)',
],
},
}]]
}, },
{ {
'target_name': 'x11', 'target_name': 'x11',
'type': 'settings', 'type': 'settings',
'direct_dependent_settings': { 'conditions': [
'cflags': [ ['_toolset=="target"', {
'<!@(<(pkg-config) --cflags x11)', 'direct_dependent_settings': {
], 'cflags': [
}, '<!@(<(pkg-config) --cflags x11)',
'link_settings': { ],
'ldflags': [ },
'<!@(<(pkg-config) --libs-only-L --libs-only-other x11)', 'link_settings': {
], 'ldflags': [
'libraries': [ '<!@(<(pkg-config) --libs-only-L --libs-only-other x11)',
'<!@(<(pkg-config) --libs-only-l x11)', ],
], 'libraries': [
}, '<!@(<(pkg-config) --libs-only-l x11)',
],
},
}]]
}, },
{ {
'target_name': 'selinux', 'target_name': 'selinux',
'type': 'settings', 'type': 'settings',
'link_settings': { 'conditions': [
'libraries': [ ['_toolset=="target"', {
'-lselinux', 'link_settings': {
], 'libraries': [
}, '-lselinux',
],
},
}]]
}, },
# TODO(evanm): temporarily disabled while we figure out whether to depend # TODO(evanm): temporarily disabled while we figure out whether to depend
# on gnome-keyring etc. # on gnome-keyring etc.
......
...@@ -2895,7 +2895,7 @@ ...@@ -2895,7 +2895,7 @@
['chromeos==1 or toolkit_views==1',{ ['chromeos==1 or toolkit_views==1',{
'dependencies': [ 'dependencies': [
'../third_party/protobuf2/protobuf.gyp:protobuf_lite', '../third_party/protobuf2/protobuf.gyp:protobuf_lite',
'../third_party/protobuf2/protobuf.gyp:protoc', '../third_party/protobuf2/protobuf.gyp:protoc#host',
'../third_party/cros/cros_api.gyp:cros_api', '../third_party/cros/cros_api.gyp:cros_api',
], ],
'actions': [ 'actions': [
...@@ -5102,7 +5102,7 @@ ...@@ -5102,7 +5102,7 @@
], ],
'dependencies': [ 'dependencies': [
'../third_party/protobuf2/protobuf.gyp:protobuf_lite', '../third_party/protobuf2/protobuf.gyp:protobuf_lite',
'../third_party/protobuf2/protobuf.gyp:protoc', '../third_party/protobuf2/protobuf.gyp:protoc#host',
], ],
'export_dependent_settings': [ 'export_dependent_settings': [
'../third_party/protobuf2/protobuf.gyp:protobuf_lite', '../third_party/protobuf2/protobuf.gyp:protobuf_lite',
......
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
{ {
'target_name': 'protobuf_lite', 'target_name': 'protobuf_lite',
'type': '<(library)', 'type': '<(library)',
'toolsets': ['host', 'target'],
'sources': [ 'sources': [
'src/src/google/protobuf/stubs/common.h', 'src/src/google/protobuf/stubs/common.h',
'src/src/google/protobuf/stubs/once.h', 'src/src/google/protobuf/stubs/once.h',
...@@ -92,6 +93,7 @@ ...@@ -92,6 +93,7 @@
{ {
'target_name': 'protobuf', 'target_name': 'protobuf',
'type': '<(library)', 'type': '<(library)',
'toolsets': ['host'],
'sources': [ 'sources': [
'src/src/google/protobuf/descriptor.h', 'src/src/google/protobuf/descriptor.h',
'src/src/google/protobuf/descriptor.pb.h', 'src/src/google/protobuf/descriptor.pb.h',
...@@ -149,6 +151,7 @@ ...@@ -149,6 +151,7 @@
{ {
'target_name': 'protoc', 'target_name': 'protoc',
'type': 'executable', 'type': 'executable',
'toolsets': ['host'],
'sources': [ 'sources': [
'src/src/google/protobuf/compiler/code_generator.cc', 'src/src/google/protobuf/compiler/code_generator.cc',
'src/src/google/protobuf/compiler/command_line_interface.cc', 'src/src/google/protobuf/compiler/command_line_interface.cc',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment