Commits

Alexey Petruchik committed f25bc93

incs parameter should be optional + unit test stub

  • Participants
  • Parent commits 897b381

Comments (0)

Files changed (2)

File src/engine/SCons/Tool/xcode.py

 
     configurationBuildSettings = {}
     for i in range(len(configuration)):
-        bs = {
-            'BUILT_PRODUCTS_DIR': os.path.dirname(os.path.abspath(runfile[i])),
-            'ARCHS': '"$(ARCHS_STANDARD_64_BIT)"',
-            'HEADER_SEARCH_PATHS': include_search_path,
-            'USER_HEADER_SEARCH_PATHS': include_search_path,
-            'PRODUCT_NAME': '"$(TARGET_NAME)"',
-            'SCONS_BUILD_TARGET': buildtarget[i],
+        configurationBuildSettings[configuration[i]] = {
+            'BUILT_PRODUCTS_DIR'       : os.path.dirname(os.path.abspath(runfile[i])),
+            'ARCHS'                    : '"$(ARCHS_STANDARD_64_BIT)"',
+            'HEADER_SEARCH_PATHS'      : include_search_path,
+            'USER_HEADER_SEARCH_PATHS' : include_search_path,
+            'PRODUCT_NAME'             : '"$(TARGET_NAME)"',
+            'SCONS_BUILD_TARGET'       : buildtarget[i],
         }
-        configurationBuildSettings[configuration[i]] = bs
 
-
-
-    print configuration
-    print map(str, buildtarget)
-    print runfile
-
-    # buildSettings = {
-    #     'BUILT_PRODUCTS_DIR': os.path.dirname(os.path.abspath(env.get('runfile', ''))),
-    #     'ARCHS': '"$(ARCHS_STANDARD_64_BIT)"',
-    #     'HEADER_SEARCH_PATHS': include_search_path,
-    #     'USER_HEADER_SEARCH_PATHS': include_search_path,
-    #     'PRODUCT_NAME': '"$(TARGET_NAME)"',
-    #     'SCONS_BUILD_TARGET': env.get('buildtarget', ''),
-    # }
+    print 'configuration:', configuration
+    print 'buildtarget:', map(str, buildtarget)
+    print 'runfile:', runfile
 
     # Create project
     project = PBXProject(context, 'Project object', project_name,configurationBuildSettings)# buildSettings)
     sourcesGroup = project.mainGroup.subgroup_by_name(project_name)
     
     # Add all source files to project's source group
-    files = env['srcs'] = env['srcs'] + env['incs']
+    files = env['srcs'] = env['srcs'] + env.get('incs', [])
     cp = os.path.commonprefix(files)
     for i in files:
         sourcesGroup.add_source(i[len(cp):], i)

File test/xcode.py

+#!/usr/bin/env python
+#
+# __COPYRIGHT__
+#
+# Permission is hereby granted, free of charge, to any person obtaining
+# a copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, sublicense, and/or sell copies of the Software, and to
+# permit persons to whom the Software is furnished to do so, subject to
+# the following conditions:
+#
+# The above copyright notice and this permission notice shall be included
+# in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
+# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+
+__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
+
+"""
+Test that we can generate Xcode project (.xcodeproj) that look correct.
+"""
+
+import os, sys, TestSCons
+
+test = TestSCons.TestSCons()
+
+if sys.platform != 'darwin':
+    msg = "Slipping Xcode test on non-OSX platform '%s'\n" % sys.platform
+    test.skip_test(msg)
+
+test.fail_test(True)