wangyu5 / gyp

Automatically exported from code.google.com/p/gyp
0 stars 0 forks source link

Make the sources list understand object files #102

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
At least on linux make, adding object files (*.o) into the sources list does 
not 
get them placed into the link line.

Fix this.  And make sure it works on all platforms.

Original issue reported on code.google.com by ajw...@chromium.org on 30 Oct 2009 at 7:20

GoogleCodeExporter commented 9 years ago
As far as I have tested, we can add object files to the sources list when 
generating XCode projects and Visual Studio projects. Even though I have 
written a quick fix for this issue <http://codereview.chromium.org/5003001/>, 
I'm not sure if it is a good change.

Regards,

Original comment by hb...@chromium.org on 15 Nov 2010 at 9:56

GoogleCodeExporter commented 9 years ago
What do we need this for?  When do we have .o files as sources?

Original comment by evan@chromium.org on 14 Dec 2010 at 5:16

GoogleCodeExporter commented 9 years ago
IIRC, this happens as the output of invoking yasm on a .asm file with 
process_outputs_as_sources = 1.

Original comment by ajw...@chromium.org on 20 Dec 2010 at 7:42

GoogleCodeExporter commented 9 years ago
Ah, I see.  I didn't realize the semantics of process_outputs_as_sources could 
add files to the link line that didn't add them to the compile steps.  This 
shouldn't be too hard to fix in gyp.

Original comment by evan@chromium.org on 20 Dec 2010 at 7:50

GoogleCodeExporter commented 9 years ago
In the case of libjpeg_turbo, the .o files are currently manually specified as 
sources:

From third_party/libjpeg_turbo/libjpeg.gyp:
[snip]
+              'sources': [
+                'simd/jsimd_i386.c',
+                # Object files assembled by the 'libjpeg_asm' project.
+                '<(shared_generated_dir)/jsimdcpu.<(object_suffix)',
+                '<(shared_generated_dir)/jccolmmx.<(object_suffix)',

and it's using a different dir for some reason I don't fully understand:

+      [ 'OS=="linux" or OS=="freebsd" or OS=="openbsd"', {
+        # This is a workaround for GYP issue 102.
+        # TODO(hbono): Delete this workaround when this issue is fixed.
+        'shared_generated_dir': 
'<(INTERMEDIATE_DIR)/third_party/libjpeg_turbo',
+      }, {
+        'shared_generated_dir': 
'<(SHARED_INTERMEDIATE_DIR)/third_party/libjpeg_turbo',
+      }],

Has anyone looked at hbono's patch for this? - 
http://codereview.chromium.org/5003001/

Original comment by craig.schlenter@chromium.org on 21 Dec 2010 at 2:58

GoogleCodeExporter commented 9 years ago
Sent out a patch for it.

Original comment by evan@chromium.org on 21 Dec 2010 at 5:46

GoogleCodeExporter commented 9 years ago
Fixed in r873.

Original comment by evan@chromium.org on 5 Jan 2011 at 8:40