From 6d187cbb7d28b4768151732148e9012682e9e4fe Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Wed, 19 Jun 2013 21:31:57 +0800 Subject: [PATCH] Build atom-shell with ninja. --- .gitignore | 1 + atom.gyp | 26 +++++++++++-------- browser/mac/Info.plist | 2 ++ common.gypi | 42 +++++++++++++++++++++++++++++++ renderer/mac/Info.plist | 2 ++ script/update | 3 ++- {script => tools/mac}/find_sdk.py | 0 tools/mac/source_root.py | 10 ++++++++ 8 files changed, 74 insertions(+), 12 deletions(-) create mode 100644 common.gypi rename {script => tools/mac}/find_sdk.py (100%) create mode 100755 tools/mac/source_root.py diff --git a/.gitignore b/.gitignore index 7eb2ff83..c09e8c02 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,7 @@ dist/ frameworks/ node/ node_modules/ +out/ vendor/ *.xcodeproj *.swp diff --git a/atom.gyp b/atom.gyp index 82e2affb..a926cae6 100644 --- a/atom.gyp +++ b/atom.gyp @@ -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 ], } diff --git a/browser/mac/Info.plist b/browser/mac/Info.plist index 971fd379..7ad4ab7f 100644 --- a/browser/mac/Info.plist +++ b/browser/mac/Info.plist @@ -6,6 +6,8 @@ com.github.atom CFBundleName ${PRODUCT_NAME} + CFBundlePackageType + APPL CFBundleIconFile atom.icns CFBundleVersion diff --git a/common.gypi b/common.gypi new file mode 100644 index 00000000..9dd0ead9 --- /dev/null +++ b/common.gypi @@ -0,0 +1,42 @@ +{ + 'variables': { + 'clang': 0, + 'source_root': 'com.github.atom.helper CFBundleName ${PRODUCT_NAME} + CFBundlePackageType + APPL LSUIElement diff --git a/script/update b/script/update index 444b2896..b10bfe23 100755 --- a/script/update +++ b/script/update @@ -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 diff --git a/script/find_sdk.py b/tools/mac/find_sdk.py 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 index 00000000..73ac5eb0 --- /dev/null +++ b/tools/mac/source_root.py @@ -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) -- 2.43.0