Build atom-shell with ninja.

This commit is contained in:
Cheng Zhao 2013-06-19 21:31:57 +08:00
parent 467b2b154f
commit 6d187cbb7d
8 changed files with 74 additions and 12 deletions

1
.gitignore vendored
View file

@ -6,6 +6,7 @@ dist/
frameworks/
node/
node_modules/
out/
vendor/
*.xcodeproj
*.swp

View file

@ -144,11 +144,10 @@
'${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}'
],
},
'includes': [
'vendor/brightray/brightray.gypi'
],
'target_defaults': {
'mac_framework_dirs': [ 'frameworks' ],
'mac_framework_dirs': [
'<(source_root)/frameworks',
],
},
'targets': [
{
@ -180,7 +179,9 @@
],
'xcode_settings': {
'INFOPLIST_FILE': 'browser/mac/Info.plist',
'LD_RUNPATH_SEARCH_PATHS': '@executable_path/../Frameworks',
'LD_RUNPATH_SEARCH_PATHS': [
'@executable_path/../Frameworks',
],
},
'copies': [
{
@ -305,11 +306,12 @@
'<(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': [
@ -346,7 +348,9 @@
'mac_bundle': 1,
'xcode_settings': {
'INFOPLIST_FILE': 'renderer/mac/Info.plist',
'LD_RUNPATH_SEARCH_PATHS': '@executable_path/../../..',
'LD_RUNPATH_SEARCH_PATHS': [
'@executable_path/../../..',
],
},
'postbuilds': [
{
@ -358,6 +362,6 @@
],
}, # target helper
],
}],
}], # OS==Mac
],
}

View 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>

42
common.gypi Normal file
View file

@ -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
],
}

View 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>

View file

@ -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

10
tools/mac/source_root.py Executable file
View file

@ -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)