]> khamidou — GitHub mirrors - electron.git/commitdiff
Build atom-shell with ninja.
authorCheng Zhao <zcbenz@gmail.com>
Wed, 19 Jun 2013 13:31:57 +0000 (21:31 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Wed, 19 Jun 2013 13:34:43 +0000 (21:34 +0800)
.gitignore
atom.gyp
browser/mac/Info.plist
common.gypi [new file with mode: 0644]
renderer/mac/Info.plist
script/update
tools/mac/find_sdk.py [moved from script/find_sdk.py with 100% similarity]
tools/mac/source_root.py [new file with mode: 0755]

index 7eb2ff83c72302e8c27122f18e394bf64e1d448b..c09e8c0292945536684313ae366ba0299265df14 100644 (file)
@@ -6,6 +6,7 @@ dist/
 frameworks/
 node/
 node_modules/
+out/
 vendor/
 *.xcodeproj
 *.swp
index 82e2affb491a24962a9ab1f759231d2829183329..a926cae6f5b19c8c78bb914f714ec5cc39e5a727 100644 (file)
--- a/atom.gyp
+++ b/atom.gyp
       '${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}'
     ],
   },
-  'includes': [
-    'vendor/brightray/brightray.gypi'
-  ],
   'target_defaults': {
-    'mac_framework_dirs': [ 'frameworks' ],
+    'mac_framework_dirs': [
+      '<(source_root)/frameworks',
+    ],
   },
   'targets': [
     {
           ],
           'xcode_settings': {
             'INFOPLIST_FILE': 'browser/mac/Info.plist',
-            'LD_RUNPATH_SEARCH_PATHS': '@executable_path/../Frameworks',
+            'LD_RUNPATH_SEARCH_PATHS': [
+              '@executable_path/../Frameworks',
+            ],
           },
           'copies': [
             {
             '<(libchromiumcontent_resources_dir)/content_shell.pak',
           ],
           'xcode_settings': {
-            'LIBRARY_SEARCH_PATHS': '<(libchromiumcontent_library_dir)',
+            'LIBRARY_SEARCH_PATHS': [
+              '<(libchromiumcontent_library_dir)',
+            ],
             'LD_DYLIB_INSTALL_NAME': '@rpath/<(product_name).framework/<(product_name)',
-            'LD_RUNPATH_SEARCH_PATHS': '@loader_path/Libraries',
-            'OTHER_LDFLAGS': [
-              '-ObjC',
+            'LD_RUNPATH_SEARCH_PATHS': [
+              '@loader_path/Libraries',
             ],
           },
           'copies': [
           'mac_bundle': 1,
           'xcode_settings': {
             'INFOPLIST_FILE': 'renderer/mac/Info.plist',
-            'LD_RUNPATH_SEARCH_PATHS': '@executable_path/../../..',
+            'LD_RUNPATH_SEARCH_PATHS': [
+              '@executable_path/../../..',
+            ],
           },
           'postbuilds': [
             {
           ],
         },  # target helper
       ],
-    }],
+    }],  # OS==Mac
   ],
 }
index 971fd379af0a708ed23909abfa933cdf17526176..7ad4ab7f4b509845578fc7102692c1c23da04c34 100644 (file)
@@ -6,6 +6,8 @@
        <string>com.github.atom</string>
        <key>CFBundleName</key>
        <string>${PRODUCT_NAME}</string>
+       <key>CFBundlePackageType</key>
+       <string>APPL</string>
   <key>CFBundleIconFile</key>
   <string>atom.icns</string>
   <key>CFBundleVersion</key>
diff --git a/common.gypi b/common.gypi
new file mode 100644 (file)
index 0000000..9dd0ead
--- /dev/null
@@ -0,0 +1,42 @@
+{
+  'variables': {
+    'clang': 0,
+    'source_root': '<!(python tools/mac/source_root.py)',
+    'conditions': [
+      ['OS=="mac"', {
+        'clang': 1,
+        'mac_sdk%': '<!(python tools/mac/find_sdk.py 10.8)',
+      }],
+    ],
+  },
+  'conditions': [
+    ['clang==1', {
+      'make_global_settings': [
+        ['CC', '/usr/bin/clang'],
+        ['CXX', '/usr/bin/clang++'],
+        ['LINK', '$(CXX)'],
+        ['CC.host', '$(CC)'],
+        ['CXX.host', '$(CXX)'],
+        ['LINK.host', '$(LINK)'],
+      ],
+      'target_defaults': {
+        'cflags_cc': [
+          '-std=c++11',
+        ],
+        'xcode_settings': {
+          'CC': '/usr/bin/clang',
+          'LDPLUSPLUS': '/usr/bin/clang++',
+          'OTHER_CPLUSPLUSFLAGS': [
+            '$(inherited)', '-std=gnu++11'
+          ],
+          'OTHER_CFLAGS': [
+            '-fcolor-diagnostics',
+          ],
+
+          'SDKROOT': 'macosx<(mac_sdk)',     # -isysroot
+          'GCC_C_LANGUAGE_STANDARD': 'c99',  # -std=c99
+        },
+      },
+    }],  # clang==1
+  ],
+}
index 3a4d0b3cb82744a00d09d506d479d926ab2aebe7..1c936760aa9e1bcec7e351696d97f9977d4c53dc 100644 (file)
@@ -6,6 +6,8 @@
        <string>com.github.atom.helper</string>
        <key>CFBundleName</key>
        <string>${PRODUCT_NAME}</string>
+       <key>CFBundlePackageType</key>
+       <string>APPL</string>
        <key>LSUIElement</key>
        <true/>
 </dict>
index 444b2896118cb327fa5cd427ea03e17e3f4104fa..b10bfe2377d33d42b9150cd6b32e3fa8a1dc5066 100755 (executable)
@@ -7,7 +7,8 @@ cd "$(dirname "$0")/.."
 ./script/update-frameworks
 ./script/update-node v0.10.9
 
-gyp --depth . atom.gyp \
+gyp -f ninja --depth . atom.gyp \
+  -Icommon.gypi \
   -Ivendor/brightray/brightray.gypi \
   -Dtarget_arch=ia32 \
   -Dlibrary=static_library
similarity index 100%
rename from script/find_sdk.py
rename to tools/mac/find_sdk.py
diff --git a/tools/mac/source_root.py b/tools/mac/source_root.py
new file mode 100755 (executable)
index 0000000..73ac5eb
--- /dev/null
@@ -0,0 +1,10 @@
+#!/usr/bin/env python
+
+import os
+
+"""Prints the absolute path of the root of atom-shell's source tree.
+"""
+
+
+relative_source_root = os.path.join(__file__, '..', '..', '..')
+print os.path.abspath(relative_source_root)