Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Unified Diff: trunk/pylib/gyp/generator/xcode.py

Issue 2878002: Xcode support for already-assembled .o (object) files as sources (Closed) Base URL: http://gyp.googlecode.com/svn/
Patch Set: Created 10 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | trunk/pylib/gyp/xcodeproj_file.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trunk/pylib/gyp/generator/xcode.py
===================================================================
--- trunk/pylib/gyp/generator/xcode.py (revision 832)
+++ trunk/pylib/gyp/generator/xcode.py (working copy)
@@ -491,8 +491,16 @@
def AddSourceToTarget(source, pbxp, xct):
- # TODO(mark): Perhaps this can be made a little bit fancier.
+ # TODO(mark): Perhaps source_extensions and library_extensions can be made a
+ # little bit fancier.
source_extensions = ['c', 'cc', 'cpp', 'cxx', 'm', 'mm', 's']
+
+ # .o is conceptually more of a "source" than a "library," but Xcode thinks
+ # of "sources" as things to compile and "libraries" (or "frameworks") as
+ # things to link with. Adding an object file to an Xcode target's frameworks
+ # phase works properly.
+ library_extensions = ['a', 'dylib', 'framework', 'o']
+
basename = posixpath.basename(source)
(root, ext) = posixpath.splitext(basename)
if ext != '':
@@ -500,9 +508,11 @@
if ext in source_extensions:
xct.SourcesPhase().AddFile(source)
+ elif ext in library_extensions:
+ xct.FrameworksPhase().AddFile(source)
else:
- # Files that aren't added to a sources build phase can still go into
- # the project file, just not as part of a build phase.
+ # Files that aren't added to a sources or frameworks build phase can still
+ # go into the project file, just not as part of a build phase.
pbxp.AddOrGetFileInRootGroup(source)
« no previous file with comments | « no previous file | trunk/pylib/gyp/xcodeproj_file.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698